[SCCP] Properly report modifications when deleting globals
authorArthur Eubanks <aeubanks@google.com>
Tue, 25 Apr 2023 22:07:40 +0000 (15:07 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 25 Apr 2023 22:08:11 +0000 (15:08 -0700)
Detected by an upcoming change.

llvm/lib/Transforms/IPO/SCCP.cpp

index 2174827..5e2a23b 100644 (file)
@@ -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;
   }