Mark scalar dependences for different statements belonging to same BB as 'Inter'.
Details
Diff Detail
Event Timeline
@Meinersbur : there is something absurd.. I added the following just before buildSchedule:
diff --git a/lib/Analysis/ScopBuilder.cpp b/lib/Analysis/ScopBuilder.cpp index 8bad622..a0d5d59 100644 --- a/lib/Analysis/ScopBuilder.cpp +++ b/lib/Analysis/ScopBuilder.cpp @@ -1051,6 +1051,13 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC) { return; } + for (ScopStmt &Stmt : scop->Stmts) { + dbgs() << Stmt; + dbgs() << Stmt.getBasicBlock(); + for (ScopStmt *Stmt1 : scop->getStmtListFor(Stmt.getBasicBlock())) + dbgs() << *Stmt1; + } + scop->buildSchedule(LI);
but Stmt1 seems to not exist.
Together with D36402, I don't see any tests failing.
The only time I see Stmt1 to no "exist" is when Stmt.getBasicBlock() returns nullptr. This happens when Stmt is a region statement, which expected.
Maybe I didn't understand your question. Can you elaborate? Which test is failing and what statement to you expect to be Stmt1?
The culprit is
void Scop::removeFromStmtMap(ScopStmt &Stmt) { if (Stmt.isRegionStmt()) for (BasicBlock *BB : Stmt.getRegion()->blocks()) { StmtMap.erase(BB); for (Instruction &Inst : *BB) InstStmtMap.erase(&Inst); } else { StmtMap.erase(Stmt.getBasicBlock()); // <-- here for (Instruction *Inst : Stmt.getInstructions()) InstStmtMap.erase(Inst); } }
It removes all statements associated with the BB, not just the one passed. After the operation, StmtMap contains no more statement for that BB, even if previously it had more than one.
LGTM.
Unfortunately the patch does apply to current trunk. Could rebase it? Thank you.
I get a compilation error:
error C2181: illegal else without matching if.
Before uploading/updating a patch, please always run "make/ninja check-polly".