summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-11-25 17:09:21 +0000
committerTobias Grosser <tobias@grosser.es>2014-11-25 17:09:21 +0000
commit154d9469f4533dc7d6af48a0e3c52d030d1b7447 (patch)
tree2003d29e1bded2666b630d53cb4b47716eeca041
parentd3aa1f4a630249026fab3513e3ad3b418a5d50ac (diff)
downloadbcm5719-llvm-154d9469f4533dc7d6af48a0e3c52d030d1b7447.tar.gz
bcm5719-llvm-154d9469f4533dc7d6af48a0e3c52d030d1b7447.zip
Add PreHeader always to OuterLoop
This fixes a bug introduce in r217525. llvm-svn: 222766
-rw-r--r--polly/lib/CodeGen/LoopGenerators.cpp7
-rw-r--r--polly/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll2
2 files changed, 5 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index 09945ecd943..af0413749d6 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -78,10 +78,11 @@ Value *polly::createLoop(Value *LB, Value *UB, Value *Stride,
else
LI.addTopLevelLoop(NewLoop);
- if (OuterLoop && GuardBB)
- OuterLoop->addBasicBlockToLoop(GuardBB, LI.getBase());
- else if (OuterLoop)
+ if (OuterLoop) {
+ if (GuardBB)
+ OuterLoop->addBasicBlockToLoop(GuardBB, LI.getBase());
OuterLoop->addBasicBlockToLoop(PreHeaderBB, LI.getBase());
+ }
NewLoop->addBasicBlockToLoop(HeaderBB, LI.getBase());
diff --git a/polly/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll b/polly/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll
index eb5c1a15b28..fd8589d32ec 100644
--- a/polly/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll
+++ b/polly/test/Isl/CodeGen/test-invalid-operands-for-select-2.ll
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl < %s | FileCheck %s
+; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl -verify-loop-info < %s | FileCheck %s
;
; Check that we do not crash as described here: http://llvm.org/bugs/show_bug.cgi?id=21167
;
OpenPOWER on IntegriCloud