[PATCH] D83976: [Mem2Reg] Teach promote to register about droppable instructions

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 11:55:40 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/IR/Value.cpp:197
+  dropDroppableUses([&](const Use *U) { return U->getUser() == &Usr; });
+}
+
----------------
jdoerfert wrote:
> fhahn wrote:
> > efriedma wrote:
> > > This seems like a dubious pattern; you're iterating over the entire use list of the value each time you call dropDroppableUsesByUser, which is likely a lot more expensive than iterating over the operand list of the assume.
> > @jdoerfert  @Tyker Any more thoughts on Eli's point?
> I have no particular preference. Unclear what is better (over time). I'll propose a follow up patch that uses the assume operands instead.
To be precise, my concern is that the overall algorithm is O(N^2) over the number of uses of the alloca.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83976





More information about the llvm-commits mailing list