diff options
author | Sebastian Pop <spop@codeaurora.org> | 2013-06-11 22:20:27 +0000 |
---|---|---|
committer | Sebastian Pop <spop@codeaurora.org> | 2013-06-11 22:20:27 +0000 |
commit | 9e3d2dd6eac076b68272f9547125998fb9e68cbb (patch) | |
tree | 4a661ca906c0ed5fcc8fc85c6aa413413ccdd926 /polly | |
parent | 70d0c820ef4dd900e1461986febb1d11f40b3e6c (diff) | |
download | bcm5719-llvm-9e3d2dd6eac076b68272f9547125998fb9e68cbb.tar.gz bcm5719-llvm-9e3d2dd6eac076b68272f9547125998fb9e68cbb.zip |
scop detection: run isValidCFG as early as possible
to discard regions with invalid CFG before going through the contents of the
basic blocks
llvm-svn: 183797
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 343ac83f3ca..335418f7958 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -390,9 +390,6 @@ bool ScopDetection::isValidInstruction(Instruction &Inst, bool ScopDetection::isValidBasicBlock(BasicBlock &BB, DetectionContext &Context) const { - if (!isValidCFG(BB, Context)) - return false; - // Check all instructions, except the terminator instruction. for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I) if (!isValidInstruction(*I, Context)) @@ -542,6 +539,11 @@ bool ScopDetection::allBlocksValid(DetectionContext &Context) const { for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E; ++I) + if (!isValidCFG(**I, Context)) + return false; + + for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E; + ++I) if (!isValidBasicBlock(**I, Context)) return false; |