[PATCH] D112315: [DSE] Use optimized access if available for redundant store elimination.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 11 10:48:11 PST 2021
asbirlea added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1991
+ MemoryDef *UpperDef;
+ if (Def->isOptimized())
+ UpperDef = dyn_cast<MemoryDef>(Def->getOptimized());
----------------
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?
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