[PATCH] D23824: [ADCE] Add handling of PHI nodes when removing control flow

David Callahan via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 10:32:35 PDT 2016


david2050 added inline comments.

================
Comment at: lib/Transforms/Scalar/ADCE.cpp:463
@@ +462,3 @@
+      }
+      if (CommonReachngDefinition != Value) {
+        // When there are two definitions from "dead" predecessor paths we
----------------
This step is necessary otherwise we delete a branch which determines a live value. It is an artifact of the semantics of PHI nodes. This is about preserving existing structure not translating to a new form. 

And Yes, outside of loops, the baseline code catches almost all cases. The primary motivation was dead, may-be-infinute loops.


https://reviews.llvm.org/D23824





More information about the llvm-commits mailing list