[PATCH] D144838: [SCCP] Correct the made changes behavior

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 02:18:13 PST 2023


chill added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:238
       continue;
-    if (tryToReplaceWithConstant(&Inst)) {
-      if (canRemoveInstruction(&Inst))
-        Inst.eraseFromParent();
-
+    if (tryToReplaceWithConstant(&Inst) && canRemoveInstruction(&Inst)) {
+      Inst.eraseFromParent();
----------------
`tryToReplaceWithConstant` will return true if it made a change and we should set the flag regardless of whether we can remove the instruction. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144838/new/

https://reviews.llvm.org/D144838



More information about the llvm-commits mailing list