summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/Analysis/ScopBuilder.cpp7
-rw-r--r--polly/test/ScopInfo/statement.ll5
2 files changed, 5 insertions, 7 deletions
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index f3623525df4..b6d2ba2e40f 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -640,8 +640,11 @@ void ScopBuilder::buildStmts(Region &SR) {
buildStmts(*I->getNodeAs<Region>());
else {
std::vector<Instruction *> Instructions;
- for (Instruction &Inst : *I->getNodeAs<BasicBlock>())
- Instructions.push_back(&Inst);
+ for (Instruction &Inst : *I->getNodeAs<BasicBlock>()) {
+ Loop *L = LI.getLoopFor(Inst.getParent());
+ if (!isa<TerminatorInst>(&Inst) && !canSynthesize(&Inst, *scop, &SE, L))
+ Instructions.push_back(&Inst);
+ }
Loop *SurroundingLoop = LI.getLoopFor(I->getNodeAs<BasicBlock>());
scop->addScopStmt(I->getNodeAs<BasicBlock>(), SurroundingLoop,
Instructions);
diff --git a/polly/test/ScopInfo/statement.ll b/polly/test/ScopInfo/statement.ll
index 2230451ecc4..d9a17a89c80 100644
--- a/polly/test/ScopInfo/statement.ll
+++ b/polly/test/ScopInfo/statement.ll
@@ -9,13 +9,8 @@
; }
; CHECK: Instructions {
-; CHECK-NEXT: %idxprom = sext i32 %i.0 to i64
-; CHECK-NEXT: %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
; CHECK-NEXT: store i32 %i.0, i32* %arrayidx, align 4
-; CHECK-NEXT: %idxprom1 = sext i32 %i.0 to i64
-; CHECK-NEXT: %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %idxprom1
; CHECK-NEXT: store i32 %i.0, i32* %arrayidx2, align 4
-; CHECK-NEXT: br label %for.inc
; CHECK-NEXT: }
; Function Attrs: noinline nounwind uwtable
OpenPOWER on IntegriCloud