summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopInfo.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-04-03 19:36:52 +0000
committerTobias Grosser <tobias@grosser.es>2016-04-03 19:36:52 +0000
commit151ae32dba245f1052e99a7f40757bdb867f24dd (patch)
treeaf99a8167112c1d6c6d074797c86f56cfd1b92e0 /polly/lib/Analysis/ScopInfo.cpp
parent8efe38a1e2c469d49548a23f4f576dfad52b40e4 (diff)
downloadbcm5719-llvm-151ae32dba245f1052e99a7f40757bdb867f24dd.tar.gz
bcm5719-llvm-151ae32dba245f1052e99a7f40757bdb867f24dd.zip
Revert "[FIX] Do not create a SCoP in the presence of infinite loops"
This reverts commit r265260, as it caused the following 'make check-polly' failures: Polly :: ScopDetect/index_from_unpredictable_loop.ll Polly :: ScopInfo/multiple_exiting_blocks.ll Polly :: ScopInfo/multiple_exiting_blocks_two_loop.ll Polly :: ScopInfo/schedule-const-post-dominator-walk-2.ll Polly :: ScopInfo/schedule-const-post-dominator-walk.ll Polly :: ScopInfo/switch-5.ll llvm-svn: 265272
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 7edc1499c47..166ddd5f824 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -3618,15 +3618,8 @@ void Scop::buildSchedule(ScopDetection &SD, LoopInfo &LI) {
Loop *L = getLoopSurroundingRegion(getRegion(), LI);
LoopStackTy LoopStack({LoopStackElementTy(L, nullptr, 0)});
buildSchedule(getRegion().getNode(), LoopStack, SD, LI);
- assert(!LoopStack.empty());
- if (LoopStack.size() == 1 && LoopStack.back().L == L) {
- Schedule = LoopStack[0].Schedule;
- } else {
- // If something went wrong we have to cleanup.
- assert(!hasFeasibleRuntimeContext());
- while (!LoopStack.empty())
- isl_schedule_free(LoopStack.pop_back_val().Schedule);
- }
+ assert(LoopStack.size() == 1 && LoopStack.back().L == L);
+ Schedule = LoopStack[0].Schedule;
}
/// To generate a schedule for the elements in a Region we traverse the Region
@@ -3669,22 +3662,9 @@ void Scop::buildSchedule(Region *R, LoopStackTy &LoopStack, ScopDetection &SD,
// iterator. If it is set we have to explore the next sub-region/block from
// the iterator (if any) to guarantee progress. If it is not set we first try
// the next queued sub-region/blocks.
- unsigned RemainingWork = WorkList.size() + DelayList.size() + 1;
while (!WorkList.empty() || !DelayList.empty()) {
- Loop *LastLoop = LoopStack.back().L;
RegionNode *RN;
- // FIXME: We will bail out if we cannot make progress. So far that is only
- // known to happen in the presence of infinite loops without an exit
- // edge. For such cases there is no region covering only the loop and
- // our reasoning fails.
- if (WorkList.size() + DelayList.size() >= RemainingWork) {
- invalidate(INFINITELOOP, R->getEntry()->getTerminator()->getDebugLoc());
- LastLoop = nullptr;
- }
-
- RemainingWork = WorkList.size() + DelayList.size();
-
if ((LastRNWaiting && !WorkList.empty()) || DelayList.size() == 0) {
RN = WorkList.front();
WorkList.pop_front();
@@ -3698,8 +3678,9 @@ void Scop::buildSchedule(Region *R, LoopStackTy &LoopStack, ScopDetection &SD,
if (!getRegion().contains(L))
L = OuterScopLoop;
+ Loop *LastLoop = LoopStack.back().L;
if (LastLoop != L) {
- if (LastLoop && !LastLoop->contains(L)) {
+ if (!LastLoop->contains(L)) {
LastRNWaiting = true;
DelayList.push_back(RN);
continue;
OpenPOWER on IntegriCloud