diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp index aff228d3ea4..5a22ea1394f 100644 --- a/tools/llvm-ld/Optimize.cpp +++ b/tools/llvm-ld/Optimize.cpp @@ -162,7 +162,7 @@ void Optimize(Module* M) { // The IPO passes may leave cruft around. Clean up after them. addPass(Passes, createInstructionCombiningPass()); - + addPass(Passes, createJumpThreadingPass()); // Thread jumps. addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas // Run a few AA driven optimizations here and now, to cleanup the code. @@ -176,6 +176,8 @@ void Optimize(Module* M) { // Cleanup and simplify the code after the scalar optimizations. addPass(Passes, createInstructionCombiningPass()); + addPass(Passes, createJumpThreadingPass()); // Thread jumps. + // Delete basic blocks, which optimization passes may have killed... addPass(Passes, createCFGSimplificationPass());