[PATCH] D20606: [PM] Schedule InstCombine after late LICM run, to clean up LCSSA nodes.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 18:53:37 PDT 2016

majnemer added inline comments.

Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:547
@@ -545,1 +546,3 @@
+    // Get rid of LCSSA nodes.
+    addInstructionCombiningPass(MPM);
mjacob wrote:
> The LCSSA will end up in the optimized output. Two cases in which this was a problem for me:
> 1) If I run additional passes after O3, e.g. late statepoint insertion for GC, they get feed with suboptimal code, possibly affecting their output. That can of course easily be worked around by running InstCombine manually in between.
> 2) I'm working on a backend which directly emits code from LLVM IR. Coworkers complained about unnecessary phi nodes. Again this can be worked around by running InstCombine manually. However that possibly obfuscates the code when debugging.
> I'm not sure whether this affects normal backends using SelectionDAG. At least I didn't find InstCombine in the llc pass pipeline.
Would InstSimplify work to get rid of these LCSSA PHI nodes?


More information about the llvm-commits mailing list