[PATCH] D118387: [IPSCCP] Switch away from Instruction::isSafeToRemove()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 09:56:27 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:102
+                                     const TargetLibraryInfo *TLI) {
+  if (wouldInstructionBeTriviallyDead(I, TLI))
+    return true;
----------------
I'd drop the TLI pass through here. SCCP should primarily be removing instructions it has simplified itself, and that shouldn't need TLI.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:109
+
+  return (!isa<CallInst>(I) || !I->mayHaveSideEffects()) && !I->isTerminator();
+}
----------------
I don't understand why we need this remaining code -- why is wouldInstructionBeTriviallyDead not sufficient?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118387



More information about the llvm-commits mailing list