[PATCH] D76350: [mlir] lower loop.if operations that yield a result
Alex Zinenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 18 06:30:21 PDT 2020
ftynse requested changes to this revision.
ftynse added a comment.
This revision now requires changes to proceed.
Unfortunately, this is harder than it looks. We need to make sure all IR changes in the pattern go through `rewriter` and we currently don't have a way of adding new block arguments there. If you are blocked by this, feel free to temporarily loop.if lowering from the pattern rewriter infra and run it as a plain IR-mutating pass.
================
Comment at: mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp:243
+ for (auto result : ifOp.results())
+ result.replaceAllUsesWith(continueBlock->addArgument(result.getType()));
+
----------------
We should not be calling `replaceAllUsesWith` inside `matchAndRewrite`, it messes up with the pattern rewriter (it tracks all transformations and may roll some changes back, going outside the rewrite makes changes untrackable and ultimately leads to tricky crashes).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76350/new/
https://reviews.llvm.org/D76350
More information about the llvm-commits
mailing list