[PATCH] D23102: [ADCE] Refactoring for new functionality (NFC)
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 10:30:57 PDT 2016
majnemer added inline comments.
================
Comment at: lib/Transforms/Scalar/ADCE.cpp:90
@@ +89,3 @@
+bool AggressiveDeadCodeElimination::isAlwaysLive(Instruction &I) {
+ if (isa<TerminatorInst>(I) || I.isEHPad() || I.mayHaveSideEffects()) {
+ // Skip any value profile instrumentation calls if they are
----------------
Would it make sense to use `!isInstructionTriviallyDead` here instead?
================
Comment at: lib/Transforms/Scalar/ADCE.cpp:91-93
@@ +90,5 @@
+ if (isa<TerminatorInst>(I) || I.isEHPad() || I.mayHaveSideEffects()) {
+ // Skip any value profile instrumentation calls if they are
+ // instrumenting constants.
+ if (!isInstrumentsConstant(I))
+ return true;
----------------
Perhaps the logic for profile instrumentation can be sunk into `isInstructionTriviallyDead`?
https://reviews.llvm.org/D23102
More information about the llvm-commits
mailing list