[llvm] 5ecdc81 - [SCCP] Properly report modifications when deleting globals

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 15:08:25 PDT 2023


Author: Arthur Eubanks
Date: 2023-04-25T15:08:11-07:00
New Revision: 5ecdc8147b0e1def0aa9c8eebff85b67f36e8766

URL: https://github.com/llvm/llvm-project/commit/5ecdc8147b0e1def0aa9c8eebff85b67f36e8766
DIFF: https://github.com/llvm/llvm-project/commit/5ecdc8147b0e1def0aa9c8eebff85b67f36e8766.diff

LOG: [SCCP] Properly report modifications when deleting globals

Detected by an upcoming change.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/SCCP.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/SCCP.cpp b/llvm/lib/Transforms/IPO/SCCP.cpp
index 2174827d4e04..5e2a23b9e62d 100644
--- a/llvm/lib/Transforms/IPO/SCCP.cpp
+++ b/llvm/lib/Transforms/IPO/SCCP.cpp
@@ -366,8 +366,8 @@ static bool runIPSCCP(
     while (!GV->use_empty()) {
       StoreInst *SI = cast<StoreInst>(GV->user_back());
       SI->eraseFromParent();
-      MadeChanges = true;
     }
+    MadeChanges = true;
     M.eraseGlobalVariable(GV);
     ++NumGlobalConst;
   }


        


More information about the llvm-commits mailing list