[PATCH] D76415: [mlir] Fix unsafe create operation in GreedyPatternRewriter
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 19 11:27:19 PDT 2020
rriddle added inline comments.
================
Comment at: mlir/lib/Transforms/Utils/FoldUtils.cpp:168
// insertion region.
- auto *insertRegion = getInsertionRegion(interfaces, op);
+ Operation &insertionPoint = *builder.getInsertionPoint();
+ auto *insertRegion = getInsertionRegion(interfaces, &insertionPoint);
----------------
rriddle wrote:
> Hmm, this is wrong. You can't assume the insertion point is on a valid operation, the block could be empty. You would need to use the block.
Passing in the insertion block instead of a builder would clean a bit of this up.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76415/new/
https://reviews.llvm.org/D76415
More information about the llvm-commits
mailing list