diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp index 9d987721e1c..96a8860e18a 100644 --- a/tools/llvm-ld/Optimize.cpp +++ b/tools/llvm-ld/Optimize.cpp @@ -201,6 +201,7 @@ void Optimize(Module* M) { if (!DisableOptimizations) { addPass(Passes, createInstructionCombiningPass()); addPass(Passes, createCFGSimplificationPass()); + addPass(Passes, createDeadCodeEliminationPass()); addPass(Passes, createGlobalDCEPass()); }