[PATCH] D12758: Allow general loops with one latch
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 07:17:38 PDT 2015
grosser accepted this revision.
grosser added a comment.
This revision is now accepted and ready to land.
Two small comments, otherwise this looks good to me.
Tobias
P.S: Please remember to add [Polly] as a tag to not confuse LLVM developers.
================
Comment at: lib/Analysis/ScopDetection.cpp:706
@@ -718,22 +705,3 @@
- // Ensure the loop has a single exiting block.
- BasicBlock *ExitingBB = L->getExitingBlock();
- if (!ExitingBB)
- return false;
-
- // Ensure the exiting block is terminated by a conditional branch.
- BranchInst *Term = dyn_cast<BranchInst>(ExitingBB->getTerminator());
- if (!Term || !Term->isConditional())
- return false;
-
- Value *Cond = Term->getCondition();
-
- // If the terminating condition is an integer comparison, ensure that it is a
- // comparison between a recurrence and an invariant value.
- if (ICmpInst *I = dyn_cast<ICmpInst>(Cond)) {
- const Value *Op0 = I->getOperand(0);
- const Value *Op1 = I->getOperand(1);
- const SCEV *LHS = SE->getSCEVAtScope(const_cast<Value *>(Op0), L);
- const SCEV *RHS = SE->getSCEVAtScope(const_cast<Value *>(Op1), L);
- if ((isa<SCEVAddRecExpr>(LHS) && !isInvariant(*Op1, CurRegion)) ||
- (isa<SCEVAddRecExpr>(RHS) && !isInvariant(*Op0, CurRegion)))
+ // Ensure the loop has a valid exiting blocks, otherwise we need to
+ // overapproximate it as a boxed loop.
----------------
typo: a valid exiting
================
Comment at: lib/Analysis/ScopInfo.cpp:1708
@@ -1615,1 +1707,3 @@
+}
+
void Scop::propagateDomainConstraints(Region *R, LoopInfo &LI,
----------------
Is it necessary to move this code around? This seems to unnecessarily complicate the diff
http://reviews.llvm.org/D12758
More information about the llvm-commits
mailing list