[llvm-branch-commits] [llvm-branch] r71565 - /llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp
Bill Wendling
isanbard at gmail.com
Tue May 12 11:00:35 PDT 2009
Author: void
Date: Tue May 12 13:00:35 2009
New Revision: 71565
URL: http://llvm.org/viewvc/llvm-project?rev=71565&view=rev
Log:
--- Merging r70422 into '.':
U lib/Analysis/ScalarEvolution.cpp
Modified:
llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp?rev=71565&r1=71564&r2=71565&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Analysis/ScalarEvolution.cpp Tue May 12 13:00:35 2009
@@ -2711,8 +2711,31 @@
return UnknownValue;
}
- //assert(0 && "Unknown SCEV type!");
- return UnknownValue;
+ if (SCEVZeroExtendExpr *Cast = dyn_cast<SCEVZeroExtendExpr>(V)) {
+ SCEVHandle Op = getSCEVAtScope(Cast->getOperand(), L);
+ if (Op == UnknownValue) return Op;
+ if (Op == Cast->getOperand())
+ return Cast; // must be loop invariant
+ return getZeroExtendExpr(Op, Cast->getType());
+ }
+
+ if (SCEVSignExtendExpr *Cast = dyn_cast<SCEVSignExtendExpr>(V)) {
+ SCEVHandle Op = getSCEVAtScope(Cast->getOperand(), L);
+ if (Op == UnknownValue) return Op;
+ if (Op == Cast->getOperand())
+ return Cast; // must be loop invariant
+ return getSignExtendExpr(Op, Cast->getType());
+ }
+
+ if (SCEVTruncateExpr *Cast = dyn_cast<SCEVTruncateExpr>(V)) {
+ SCEVHandle Op = getSCEVAtScope(Cast->getOperand(), L);
+ if (Op == UnknownValue) return Op;
+ if (Op == Cast->getOperand())
+ return Cast; // must be loop invariant
+ return getTruncateExpr(Op, Cast->getType());
+ }
+
+ assert(0 && "Unknown SCEV type!");
}
/// getSCEVAtScope - Return a SCEV expression handle for the specified value
More information about the llvm-branch-commits
mailing list