[PATCH] D120842: [DSE] Cache liveOnEntry as clobbering access

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 12:46:10 PST 2022


reames created this revision.
reames added reviewers: fhahn, asbirlea.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added a project: LLVM.

This builds on @fhahn's D112313 <https://reviews.llvm.org/D112313>, and caches the liveOnEntry node as a optimized access.  D112313 <https://reviews.llvm.org/D112313> tied to only cache a known clobber.  This change adds caching the fact that no clobber exists.  It still does not cache may-clobber results.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120842

Files:
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp


Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1241,6 +1241,9 @@
       // Reached TOP.
       if (MSSA.isLiveOnEntryDef(Current)) {
         LLVM_DEBUG(dbgs() << "   ...  found LiveOnEntryDef\n");
+        if (CanOptimize && Current != KillingDef->getDefiningAccess())
+          // The first clobbering def is... none.
+          KillingDef->setOptimized(Current);
         return None;
       }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120842.412514.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220302/4d99c783/attachment-0001.bin>


More information about the llvm-commits mailing list