[llvm] [GVN] Improve processBlock for instruction erasure (PR #131753)
    Nikita Popov via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Apr 28 13:52:10 PDT 2025
    
    
  
================
@@ -2206,13 +2210,13 @@ bool GVNPass::processLoad(LoadInst *L) {
   // MaterializeAdjustedValue is responsible for combining metadata.
   ICF->removeUsersOf(L);
   L->replaceAllUsesWith(AvailableValue);
-  markInstructionForDeletion(L);
   if (MSSAU)
     MSSAU->removeMemoryAccess(L);
   ++NumGVNLoad;
   reportLoadElim(L, AvailableValue, ORE);
   // Tell MDA to reexamine the reused pointer since we might have more
   // information after forwarding it.
+  doInstructionDeletion(L);
----------------
nikic wrote:
Move this above the comment about MDA (which is about the lines below).
https://github.com/llvm/llvm-project/pull/131753
    
    
More information about the llvm-commits
mailing list