[PATCH] D118392: [SCCP][FuncSpec] Switch away from Instruction::isSafeToRemove()

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 12:11:55 PDT 2022


kpn updated this revision to Diff 440718.
kpn added a comment.

Move more of Instruction::isSafeToRemove() into this function. The remainder of isSafeToRemove() isn't needed because we filter out function calls at the top of the changed function.


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

https://reviews.llvm.org/D118392

Files:
  llvm/lib/Transforms/IPO/FunctionSpecialization.cpp


Index: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
===================================================================
--- llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -376,7 +376,7 @@
 
     // Remove the instruction from Block and Solver.
     if (auto *I = dyn_cast<Instruction>(V)) {
-      if (I->isSafeToRemove()) {
+      if (!I->isTerminator() && !I->isEHPad()) {
         ReplacedWithConstant.push_back(I);
         Solver.removeLatticeValueFor(I);
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118392.440718.patch
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/35bb045b/attachment.bin>


More information about the llvm-commits mailing list