[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
Thu Nov 11 13:38:45 PST 2021


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1991
+      MemoryDef *UpperDef;
+      if (Def->isOptimized())
+        UpperDef = dyn_cast<MemoryDef>(Def->getOptimized());
----------------
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?


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