LTO: Add the loop vectorizer to the LTO pipeline.
authorArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 24 Feb 2014 18:19:31 +0000 (18:19 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 24 Feb 2014 18:19:31 +0000 (18:19 +0000)
During the LTO phase LICM will move loop invariant global variables out of loops
(informed by GlobalModRef). This makes more loops countable presenting
opportunity for the loop vectorizer.

Adding the loop vectorizer improves some TSVC benchmarks and twolf/ref dataset
(5%) on x86-64.

radar://15970632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202051 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/PassManagerBuilder.cpp

index 69e6526c73190163e229c491e5589b7d94f0eb24..21d8e58db7cda70f92b68b69236388f150d863f2 100644 (file)
@@ -331,6 +331,9 @@ void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
   // Nuke dead stores.
   PM.add(createDeadStoreEliminationPass());
 
+  // More loops are countable try to vectorize them.
+  PM.add(createLoopVectorizePass(true, true));
+
   // Cleanup and simplify the code after the scalar optimizations.
   PM.add(createInstructionCombiningPass());