jump threading can introduce allocas, make sure we promote
authorChris Lattner <sabre@nondot.org>
Wed, 25 Jun 2008 16:54:18 +0000 (16:54 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Jun 2008 16:54:18 +0000 (16:54 +0000)
them back to registers!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52729 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto2/LTOCodeGenerator.cpp

index 5b7a067b4c389cf4400cac14e12f5eedbc8f9781..d82279d494fc56a380911ccf0eb3910fa417beb0 100644 (file)
@@ -386,6 +386,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.
+    passes.add(createPromoteMemoryToRegisterPass()); // Cleanup after threading.
+
 
     // Delete basic blocks, which optimization passes may have killed...
     passes.add(createCFGSimplificationPass());