Do some preparation even with scalar and phi modeling enabled

llvm-svn: 230790
This commit is contained in:
Johannes Doerfert 2015-02-27 20:38:51 +00:00
parent 78bea7395f
commit 5079200510
2 changed files with 7 additions and 9 deletions

View File

@ -201,14 +201,12 @@ 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);
if (!PollyModelPHINodes)
eliminatePHINodes(F);
return false;

View 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,12 +531,14 @@ bool IndependentBlocks::runOnFunction(llvm::Function &F) {
Changed |= createIndependentBlocks(R);
Changed |= eliminateDeadCode(R);
// This may change the RegionTree.
if (!DisableIntraScopScalarToArray || !PollyModelPHINodes)
Changed |= splitExitBlock(const_cast<Region *>(R));
}
DEBUG(dbgs() << "Before Scalar to Array------->\n");
DEBUG(F.dump());
if (!DisableIntraScopScalarToArray || !PollyModelPHINodes)
for (const Region *R : *SD)
Changed |= translateScalarToArray(R);