[llvm] [DSE] Apply initializes attribute to DSE (PR #107282)
    Haopeng Liu via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Oct 17 21:01:57 PDT 2024
    
    
  
================
@@ -2232,8 +2366,11 @@ DSEState::eliminateDeadDefs(const MemoryLocationWrapper &KillingLocWrapper) {
     }
     MemoryDefWrapper DeadDefWrapper(
         cast<MemoryDef>(DeadAccess),
-        getLocForInst(cast<MemoryDef>(DeadAccess)->getMemoryInst()));
-    MemoryLocationWrapper &DeadLocWrapper = *DeadDefWrapper.DefinedLocation;
+        getLocForInst(cast<MemoryDef>(DeadAccess)->getMemoryInst(),
+                      /*ConsiderInitializesAttr=*/false));
+    assert(DeadDefWrapper.DefinedLocations.size() == 1);
+    MemoryLocationWrapper &DeadLocWrapper =
+        DeadDefWrapper.DefinedLocations.front();
----------------
haopliu wrote:
Ooh, missed this comment. Added a TODO about isRemovable(). Thanks!
https://github.com/llvm/llvm-project/pull/107282
    
    
More information about the llvm-commits
mailing list