[polly] r304151 - [ScopInfo] Do not add terminator & synthesizable instructions to the output instructions.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Mon May 29 05:27:39 PDT 2017
Author: meinersbur
Date: Mon May 29 07:27:38 2017
New Revision: 304151
URL: http://llvm.org/viewvc/llvm-project?rev=304151&view=rev
Log:
[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
Modified:
polly/trunk/lib/Analysis/ScopBuilder.cpp
polly/trunk/test/ScopInfo/statement.ll
Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=304151&r1=304150&r2=304151&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Mon May 29 07:27:38 2017
@@ -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);
Modified: polly/trunk/test/ScopInfo/statement.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/statement.ll?rev=304151&r1=304150&r2=304151&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/statement.ll (original)
+++ polly/trunk/test/ScopInfo/statement.ll Mon May 29 07:27:38 2017
@@ -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
More information about the llvm-commits
mailing list