Add jump threading to liblto.
authorChris Lattner <sabre@nondot.org>
Mon, 21 Apr 2008 04:31:40 +0000 (04:31 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Apr 2008 04:31:40 +0000 (04:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50028 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto2/LTOCodeGenerator.cpp

index 4c5850acb4fc3577c3a88fc4ff0ffa9799f8ac0a..b7962be50bec7afd6e14fa588989068a144de149 100644 (file)
@@ -370,7 +370,7 @@ bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errM
 
     // The IPO passes may leave cruft around.  Clean up after them.
     passes.add(createInstructionCombiningPass());
-
+    passes.add(createJumpThreadingPass());        // Thread jumps.
     passes.add(createScalarReplAggregatesPass()); // Break up allocas
 
     // Run a few AA driven optimizations here and now, to cleanup the code.
@@ -384,6 +384,8 @@ bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errM
     // Cleanup and simplify the code after the scalar optimizations.
     passes.add(createInstructionCombiningPass());
 
+    passes.add(createJumpThreadingPass());        // Thread jumps.
+
     // Delete basic blocks, which optimization passes may have killed...
     passes.add(createCFGSimplificationPass());