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

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 15:24:43 PDT 2020


Tyker added inline comments.


================
Comment at: llvm/lib/IR/Value.cpp:197
+  dropDroppableUses([&](const Use *U) { return U->getUser() == &Usr; });
+}
+
----------------
jdoerfert wrote:
> efriedma wrote:
> > 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.
> D84804 should address this.
i agree with Eli, i tried express my concern about that in https://reviews.llvm.org/D83976?id=280542#inline-775547


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