Do some preparation even with scalar and phi modeling enabled
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>
Fri, 27 Feb 2015 20:38:51 +0000 (20:38 +0000)
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>
Fri, 27 Feb 2015 20:38:51 +0000 (20:38 +0000)
llvm-svn: 230790

polly/lib/Transform/CodePreparation.cpp
polly/lib/Transform/IndependentBlocks.cpp

index 000e283..39c2acc 100644 (file)
@@ -201,15 +201,13 @@ void CodePreparation::getAnalysisUsage(AnalysisUsage &AU) const {
 }
 
 bool CodePreparation::runOnFunction(Function &F) {
-  if (PollyModelPHINodes)
-    return false;
-
   LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
   SE = &getAnalysis<ScalarEvolution>();
 
   splitEntryBlockForAlloca(&F.getEntryBlock(), this);
 
-  eliminatePHINodes(F);
+  if (!PollyModelPHINodes)
+    eliminatePHINodes(F);
 
   return false;
 }
index c5b2663..8868b8f 100644 (file)
@@ -515,8 +515,6 @@ void IndependentBlocks::getAnalysisUsage(AnalysisUsage &AU) const {
 }
 
 bool IndependentBlocks::runOnFunction(llvm::Function &F) {
-  if (DisableIntraScopScalarToArray && PollyModelPHINodes)
-    return false;
 
   bool Changed = false;
 
@@ -533,14 +531,16 @@ bool IndependentBlocks::runOnFunction(llvm::Function &F) {
     Changed |= createIndependentBlocks(R);
     Changed |= eliminateDeadCode(R);
     // This may change the RegionTree.
-    Changed |= splitExitBlock(const_cast<Region *>(R));
+    if (!DisableIntraScopScalarToArray || !PollyModelPHINodes)
+      Changed |= splitExitBlock(const_cast<Region *>(R));
   }
 
   DEBUG(dbgs() << "Before Scalar to Array------->\n");
   DEBUG(F.dump());
 
-  for (const Region *R : *SD)
-    Changed |= translateScalarToArray(R);
+  if (!DisableIntraScopScalarToArray || !PollyModelPHINodes)
+    for (const Region *R : *SD)
+      Changed |= translateScalarToArray(R);
 
   DEBUG(dbgs() << "After Independent Blocks------------->\n");
   DEBUG(F.dump());