[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 07:36:19 PDT 2020


ftynse added a comment.

In D76350#1928935 <https://reviews.llvm.org/D76350#1928935>, @gysit wrote:

> I guess I have multiple patterns where I use replaceAllUsesWith(). Can a rollback happen even if there is no code path that later on returns failure()? I ask since my stuff seems to work so far.


The only case where it is actually necessary is replacing block arguments. Otherwise, you can do `rewriter.replaceOp(op-that-defines-the-value, new-values)`.

Currently, we don't rollback if patterns don't fail. However, you don't necessarily have a guarantee that your patterns won't be combined with other patterns that may fail...


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