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 <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini 2016-04-25 08:47:49 +00:00
parent 7d2a81594a
commit 3f9946eb0d

View File

@ -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;