[PATCH] D76268: [MLIR] Fix op folding to not run pre-replace when not constant folding

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 23:25:35 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/lib/Transforms/Utils/FoldUtils.cpp:92
 
-  // Otherwise, replace all of the result values and erase the operation.
+  // Constant folding succeeded. We will start replacing this op's uses and
+  // erase this op. Invoke the callback provided by the caller to perform any
----------------
Hmmm, can we instead add a flag to the callback detailing if the op was just updated in-place? I'd say for canonicalization we still want to reconsider the original operands and the users of the operation even when it gets updated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76268/new/

https://reviews.llvm.org/D76268





More information about the llvm-commits mailing list