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

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 11:02:15 PDT 2022


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

Update for review comment: just use wouldInstructionBeTriviallyDead().


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
@@ -55,6 +55,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/Transforms/Scalar/SCCP.h"
 #include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Transforms/Utils/SCCPSolver.h"
 #include "llvm/Transforms/Utils/SizeOpts.h"
 #include <cmath>
@@ -376,7 +377,7 @@
 
     // Remove the instruction from Block and Solver.
     if (auto *I = dyn_cast<Instruction>(V)) {
-      if (I->isSafeToRemove()) {
+      if (wouldInstructionBeTriviallyDead(I)) {
         ReplacedWithConstant.push_back(I);
         Solver.removeLatticeValueFor(I);
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118392.462552.patch
Type: text/x-patch
Size: 829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220923/4e3a0285/attachment.bin>


More information about the llvm-commits mailing list