Skip to content

Commit f0897cb

Browse files
committed
fix check
1 parent aeebd0f commit f0897cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Dialect/SCF/Transforms/UpliftWhileToFor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct UpliftWhileOp : public OpRewritePattern<scf::WhileOp> {
4242
"Loop body must have single cmp op");
4343

4444
scf::ConditionOp beforeTerm = loop.getConditionOp();
45-
if (!cmp->hasOneUse() && beforeTerm.getCondition() == cmp.getResult())
45+
if (!cmp->hasOneUse() || beforeTerm.getCondition() != cmp.getResult())
4646
return rewriter.notifyMatchFailure(loop, [&](Diagnostic &diag) {
4747
diag << "Expected single condition use: " << *cmp;
4848
});

0 commit comments

Comments
 (0)