[PATCH] D18762: Add Aggressive Control Dead Code Elimination
David Callahan via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 13:27:53 PDT 2016
david2050 marked 10 inline comments as done.
david2050 added a comment.
Thanks for the review
================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:321-322
@@ +320,4 @@
+ MPM.add(createAggressiveControlDCEPass()); // Delete dead instructions
+ }
+ else {
+ MPM.add(createAggressiveDCEPass()); // Delete dead instructions
----------------
majnemer wrote:
> Please format this appropriately.
I assume this means removing the braces.
================
Comment at: lib/Transforms/Scalar/ACDCE.cpp:508-513
@@ +507,8 @@
+bool AggressiveControlDCE::alwaysLive(Instruction &I) const {
+ if (I.isEHPad() || I.mayHaveSideEffects()) {
+ if (isInstrumentsConstant(I)) {
+ return false;
+ }
+ return true;
+ }
+ if (!isa<TerminatorInst>(I)) {
----------------
majnemer wrote:
> Why are EHPads always considered live?
I cribbed the condition from the existing ADCE pass. I assumed that it would be impossible to remove the corresponding invoke so simplest to just keep the operation live.
http://reviews.llvm.org/D18762
More information about the llvm-commits
mailing list