summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2013-06-11 22:20:32 +0000
committerSebastian Pop <spop@codeaurora.org>2013-06-11 22:20:32 +0000
commitb88ea5e991c09d467b97bf251217820bec569b6d (patch)
tree48170ce58e03ced9945ad034fee61715f630ba8d
parent9e3d2dd6eac076b68272f9547125998fb9e68cbb (diff)
downloadbcm5719-llvm-b88ea5e991c09d467b97bf251217820bec569b6d.tar.gz
bcm5719-llvm-b88ea5e991c09d467b97bf251217820bec569b6d.zip
scop detection: run isValidLoop as early as possible
to discard regions with invalid loops before going through the contents of the basic blocks llvm-svn: 183798
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 335418f7958..6d3f26a45c2 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -395,10 +395,6 @@ bool ScopDetection::isValidBasicBlock(BasicBlock &BB,
if (!isValidInstruction(*I, Context))
return false;
- Loop *L = LI->getLoopFor(&BB);
- if (L && L->getHeader() == &BB && !isValidLoop(L, Context))
- return false;
-
return true;
}
@@ -538,6 +534,13 @@ bool ScopDetection::allBlocksValid(DetectionContext &Context) const {
Region &R = Context.CurRegion;
for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
+ ++I) {
+ Loop *L = LI->getLoopFor(*I);
+ if (L && L->getHeader() == *I && !isValidLoop(L, Context))
+ return false;
+ }
+
+ for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
++I)
if (!isValidCFG(**I, Context))
return false;
OpenPOWER on IntegriCloud