Add a loop rerolling flag to the PassManagerBuilder
authorHal Finkel <hfinkel@anl.gov>
Sun, 17 Nov 2013 16:02:50 +0000 (16:02 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 17 Nov 2013 16:02:50 +0000 (16:02 +0000)
This adds a boolean member variable to the PassManagerBuilder to control loop
rerolling (just like we have for unrolling and the various vectorization
options). This is necessary for control by the frontend. Loop rerolling remains
disabled by default at all optimization levels.

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

include/llvm/Transforms/IPO/PassManagerBuilder.h
lib/Transforms/IPO/PassManagerBuilder.cpp

index 3648a3dd6b00c6a3daa1612ef69192d8a0981449..27887749e9607fe75bb58bc455fb46aed840ef68 100644 (file)
@@ -112,6 +112,7 @@ public:
   bool SLPVectorize;
   bool LoopVectorize;
   bool LateVectorize;
+  bool RerollLoops;
 
 private:
   /// ExtensionList - This is list of all of the extensions that are registered.
index 5399e6865a7c64052577bad61fa11c2f40bacdec..24c5018d54219b8a38ffca602ff5e33ca95cd6e7 100644 (file)
@@ -69,6 +69,7 @@ PassManagerBuilder::PassManagerBuilder() {
     SLPVectorize = RunSLPVectorization;
     LoopVectorize = RunLoopVectorization;
     LateVectorize = LateVectorization;
+    RerollLoops = RunLoopRerolling;
 }
 
 PassManagerBuilder::~PassManagerBuilder() {
@@ -220,7 +221,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
 
   addExtensionsToPM(EP_ScalarOptimizerLate, MPM);
 
-  if (RunLoopRerolling)
+  if (RerollLoops)
     MPM.add(createLoopRerollPass());
   if (SLPVectorize)
     MPM.add(createSLPVectorizerPass());   // Vectorize parallel scalar chains.