git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286480
91177308-0d34-0410-b5e6-
96231b3b80d8
if (MergeFunctions)
MPM.add(createMergeFunctionsPass());
+ // LoopSink pass sinks instructions hoisted by LICM, which serves as a
+ // canonicalization pass that enables other optimizations. As a result,
+ // LoopSink pass needs to be a very late IR pass to avoid undoing LICM
+ // result too early.
MPM.add(createLoopSinkPass());
// Get rid of LCSSA nodes.
MPM.add(createInstructionSimplifierPass());