Skip to content

Commit 8ac2565

Browse files
authoredFeb 14, 2025··
scalarize select condition for LLVM where possible (#8575)
1 parent 6762e9c commit 8ac2565

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/CodeGen_LLVM.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,11 @@ void CodeGen_LLVM::visit(const Not *op) {
18731873
}
18741874

18751875
void CodeGen_LLVM::visit(const Select *op) {
1876-
Value *cmp = codegen(op->condition);
1876+
Expr cond = op->condition;
1877+
if (const Broadcast *bc = cond.as<Broadcast>()) {
1878+
cond = bc->value;
1879+
}
1880+
Value *cmp = codegen(cond);
18771881
Value *a = codegen(op->true_value);
18781882
Value *b = codegen(op->false_value);
18791883
if (a->getType()->isVectorTy()) {

0 commit comments

Comments
 (0)
Please sign in to comment.