summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2017-05-29 12:27:38 +0000
committerMichael Kruse <llvm@meinersbur.de>2017-05-29 12:27:38 +0000
commited0c2f7e9090a9baf5f738d1210a1ebe04023594 (patch)
tree1e4d26640313c5f85dd4f66da3d3bc7aecbd9398
parentb808e99a558fceed89d39d76895615b584567f95 (diff)
downloadbcm5719-llvm-ed0c2f7e9090a9baf5f738d1210a1ebe04023594.tar.gz
bcm5719-llvm-ed0c2f7e9090a9baf5f738d1210a1ebe04023594.zip
[ScopInfo] Do not add terminator & synthesizable instructions to the output instructions.
Such instructions are generates on-demand by the CodeGenerator and thus do not need representation in a statement. Differential Revision: https://reviews.llvm.org/D33642 llvm-svn: 304151
-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