]> granicus.if.org Git - llvm/commitdiff
Add comments about why we put LoopSink pass at the very late stage.
authorDehao Chen <dehao@google.com>
Thu, 10 Nov 2016 17:42:18 +0000 (17:42 +0000)
committerDehao Chen <dehao@google.com>
Thu, 10 Nov 2016 17:42:18 +0000 (17:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286480 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/PassManagerBuilder.cpp

index c340da4a2b21c7ceed6e4796b475931832e8d139..1caa591f587d726bf34b4edff56b6e91f88e6166 100644 (file)
@@ -647,6 +647,10 @@ void PassManagerBuilder::populateModulePassManager(
   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());