[PATCH] D112315: [DSE] Use optimized access if available for redundant store elimination.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 02:26:18 PST 2021


fhahn marked 2 inline comments as done.
fhahn added a comment.

ping :)



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1991
+      MemoryDef *UpperDef;
+      if (Def->isOptimized())
+        UpperDef = dyn_cast<MemoryDef>(Def->getOptimized());
----------------
asbirlea wrote:
> fhahn wrote:
> > asbirlea wrote:
> > > Can you please add a comment to document this choice?
> > > 
> > > This is unusual ... the typical way to do this is: `upperDef = getClobberingMemoryAccess` which internally returns the optimized access if already optimized, or does the walk if not. 
> > > You're looking for bypassing that, due to increase in compile time from the walk. You want the optimized if available, but to not do the walk otherwise and default to the defining access.
> > > 
> > > Would adding a new API (e.g. `getOptimizedIfAvailable`) for this sort of info be useful?
> > Thanks, I added a comment to hopefully make things clearer.
> > 
> > > Would adding a new API (e.g. getOptimizedIfAvailable) for this sort of info be useful?
> > 
> > I'm not sure if it is worth to do so just yet. Do you anticipate this kind of use-case to become more common?
> I don't have another use case in mind at the moment, so agreed on keeping it as is; the comment is good.
Thanks, so is this now good as is?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112315



More information about the llvm-commits mailing list