[PATCH] D72802: [mlir] Introduce bare ptr calling convention for MemRefs in LLVM dialect

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 08:35:12 PST 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Transforms/DialectConversion.h:324
   /// Replace all the uses of the block argument `from` with value `to`.
-  void replaceUsesOfBlockArgument(BlockArgument from, Value to);
+  void replaceUsesOfWith(Value from, Value to);
 
----------------
ftynse wrote:
> dcaballe wrote:
> > dcaballe wrote:
> > > rriddle wrote:
> > > > This function is already broken, I'd rather not expand its scope until its fixed.
> > > It's currently being used. Why is it broken?
> > > Maybe I could just replace all the uses (lines 683 and 687) with other utilities but I thought adding a mapping from 'from' to 'to' to pattern-rewriter would be necessary.  
> > I tried using `replaceAllUsesWith` but it didn't work. The mapping from 'from' to 'to' is needed. I don't see any other option. Any suggestions?
> @rriddle could you please elaborate on how exactly it is broken?
Sorry, I sent this when I was OOO and it got lost in my email. The current problem is that the transformation isn't "revertible". If a pattern that uses it would fail, there isn't a guarantee that the IR will be reverted to its original state. It currently internally directly replaces the uses of the argument, which isn't valid given that everything in DialectConversion has to be undoable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72802





More information about the llvm-commits mailing list