[llvm] 00a877f - [DSE] Cache liveOnEntry as clobbering access

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 11:40:09 PST 2022


Author: Philip Reames
Date: 2022-03-03T11:36:21-08:00
New Revision: 00a877f96af7da2723aedbb73918eeb2d38c960b

URL: https://github.com/llvm/llvm-project/commit/00a877f96af7da2723aedbb73918eeb2d38c960b
DIFF: https://github.com/llvm/llvm-project/commit/00a877f96af7da2723aedbb73918eeb2d38c960b.diff

LOG: [DSE] Cache liveOnEntry as clobbering access

This builds on @fhahn's D112313, and caches the liveOnEntry node as a optimized access. 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.

Differential Revision: https://reviews.llvm.org/D120842

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index fd6c6014b45de..60196e3f3d934 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1237,6 +1237,9 @@ struct DSEState {
       // 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;
       }
 


        


More information about the llvm-commits mailing list