From bf4513b9aa2bb27b0464b8f9d047b6c8d26699cd Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 25 Apr 2016 08:47:49 +0000 Subject: Run GlobalOpt before emitting the bitcode for ThinLTO This is motivated by reducing the size of the IR and thus reduce compile time. From: Mehdi Amini llvm-svn: 267385 --- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 7867bf44a52..0dc44c660f1 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -404,6 +404,8 @@ void PassManagerBuilder::populateModulePassManager( // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes // during ThinLTO and perform the rest of the optimizations afterward. if (PrepareForThinLTO) { + // Reduce the size of the IR as much as possible. + MPM.add(createGlobalOptimizerPass()); // Rename anon function to be able to export them in the summary. MPM.add(createNameAnonFunctionPass()); return; -- cgit v1.2.3