We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f6043e commit a289930Copy full SHA for a289930
mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -3582,8 +3582,9 @@ struct WhileMoveIfDown : public OpRewritePattern<WhileOp> {
3582
3583
LogicalResult matchAndRewrite(WhileOp op,
3584
PatternRewriter &rewriter) const override {
3585
- // Check that the first operation in the before region is an scf.if whose
3586
- // condition matches the condition of the scf.condition op.
+ // Check that the first opeation produces one result and that result must
+ // have exactly two uses (these two uses come from the `scf.if` and
3587
+ // `scf.condition` operations).
3588
Operation &condOp = op.getBeforeBody()->front();
3589
if (condOp.getNumResults() != 1 || !condOp.getResult(0).hasNUses(2))
3590
return failure();
0 commit comments