[llvm-commits] [llvm] r111039 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Fri Aug 13 13:23:25 PDT 2010
Author: djg
Date: Fri Aug 13 15:23:25 2010
New Revision: 111039
URL: http://llvm.org/viewvc/llvm-project?rev=111039&view=rev
Log:
When testing whether one loop contains another, test this directly
rather than testing whether the loop contains the other's header.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111039&r1=111038&r2=111039&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Aug 13 15:23:25 2010
@@ -2047,9 +2047,9 @@
// Canonicalize nested AddRecs in by nesting them in order of loop depth.
if (const SCEVAddRecExpr *NestedAR = dyn_cast<SCEVAddRecExpr>(Operands[0])) {
const Loop *NestedLoop = NestedAR->getLoop();
- if (L->contains(NestedLoop->getHeader()) ?
+ if (L->contains(NestedLoop) ?
(L->getLoopDepth() < NestedLoop->getLoopDepth()) :
- (!NestedLoop->contains(L->getHeader()) &&
+ (!NestedLoop->contains(L) &&
DT->dominates(L->getHeader(), NestedLoop->getHeader()))) {
SmallVector<const SCEV *, 4> NestedOperands(NestedAR->op_begin(),
NestedAR->op_end());
More information about the llvm-commits
mailing list