jump threading can introduce allocas, make sure we promote
them back to registers!
llvm-svn: 52729
diff --git a/llvm/tools/lto2/LTOCodeGenerator.cpp b/llvm/tools/lto2/LTOCodeGenerator.cpp
index 5b7a067..d82279d 100644
--- a/llvm/tools/lto2/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto2/LTOCodeGenerator.cpp
@@ -386,6 +386,8 @@
// 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());