[PATCH] D77485: [MLIR] Handle in-place folding properly in greedy pattern rewrite driver
Uday Bondhugula via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 11 01:02:20 PDT 2020
bondhugula added inline comments.
================
Comment at: mlir/lib/Transforms/Utils/FoldUtils.cpp:78
+ function_ref<void(Operation *)> preReplaceAction, bool *inPlaceUpdate) {
+ if (inPlaceUpdate)
+ *inPlaceUpdate = false;
----------------
rriddle wrote:
> Can we just have this as a precondition? That avoids uninitialized variables being passed in.
Sorry, I didn't get you. Did you mean making `inPlaceUpdate` a compulsory parameter and asserting `inPlaceUpdate` (in which case we can instead just pass by reference) or adding `assert(!*inPlaceUpdate && 'should be initialized to false');`? Thanks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77485/new/
https://reviews.llvm.org/D77485
More information about the llvm-commits
mailing list