Skip to content
Snippets Groups Projects
Commit 536ba30b authored by Wu Zhao's avatar Wu Zhao Committed by Tianqi Chen
Browse files

[LLVM CodeGen] Solve LLVM CodeGen br instruction accept not-i1 type issue (#2381)

parent b3375702
No related branches found
No related tags found
No related merge requests found
......@@ -95,8 +95,10 @@ class UnsafeSelectRewriter : public IRMutator {
Expr expr = IRMutator::Mutate_(op, e);
op = expr.as<Select>();
UnsafeExprDetector unsafe;
if (unsafe.VisitExpr(op->true_value) ||
unsafe.VisitExpr(op->false_value)) {
bool cond_is_scalar_bool = op->condition.type().is_bool() && op->condition.type().is_scalar();
if ((unsafe.VisitExpr(op->true_value) ||
unsafe.VisitExpr(op->false_value)) &&
cond_is_scalar_bool) {
return Call::make(
op->type,
intrinsic::tvm_if_then_else,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment