Skip to content

Commit 1868570

Browse files
author
git apple-llvm automerger
committed
Merge commit '59bdb0bb91a0' from llvm.org/release/21.x into stable/21.x
2 parents 330cdc5 + 59bdb0b commit 1868570

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ LogicalResult WhileLowering::matchAndRewrite(WhileOp whileOp,
582582
// block. This should be reconsidered if we allow break/continue in SCF.
583583
rewriter.setInsertionPointToEnd(before);
584584
auto condOp = cast<ConditionOp>(before->getTerminator());
585+
SmallVector<Value> args = llvm::to_vector(condOp.getArgs());
585586
rewriter.replaceOpWithNewOp<cf::CondBranchOp>(condOp, condOp.getCondition(),
586587
after, condOp.getArgs(),
587588
continuation, ValueRange());
@@ -593,7 +594,7 @@ LogicalResult WhileLowering::matchAndRewrite(WhileOp whileOp,
593594

594595
// Replace the op with values "yielded" from the "before" region, which are
595596
// visible by dominance.
596-
rewriter.replaceOp(whileOp, condOp.getArgs());
597+
rewriter.replaceOp(whileOp, args);
597598

598599
return success();
599600
}

0 commit comments

Comments
 (0)