[llvm-branch-commits] [llvm-branch] r119618 - in /llvm/branches/Apple/whitney: include/llvm/Analysis/ScalarEvolutionExpressions.h lib/Analysis/ScalarEvolution.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 17 18:35:58 PST 2010
Author: ddunbar
Date: Wed Nov 17 20:35:58 2010
New Revision: 119618
URL: http://llvm.org/viewvc/llvm-project?rev=119618&view=rev
Log:
Merge r119554:
--
Author: Dan Gohman <gohman at apple.com>
Date: Wed Nov 17 20:48:38 2010 +0000
Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.
Modified:
llvm/branches/Apple/whitney/include/llvm/Analysis/ScalarEvolutionExpressions.h
llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/branches/Apple/whitney/include/llvm/Analysis/ScalarEvolutionExpressions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=119618&r1=119617&r2=119618&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/Analysis/ScalarEvolutionExpressions.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/Analysis/ScalarEvolutionExpressions.h Wed Nov 17 20:35:58 2010
@@ -373,11 +373,7 @@
SCEVAddRecExpr(const FoldingSetNodeIDRef ID,
const SCEV *const *O, size_t N, const Loop *l)
- : SCEVNAryExpr(ID, scAddRecExpr, O, N), L(l) {
- for (size_t i = 0, e = NumOperands; i != e; ++i)
- assert(Operands[i]->isLoopInvariant(l) &&
- "Operands of AddRec must be loop-invariant!");
- }
+ : SCEVNAryExpr(ID, scAddRecExpr, O, N), L(l) {}
public:
const SCEV *getStart() const { return Operands[0]; }
Modified: llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp?rev=119618&r1=119617&r2=119618&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp Wed Nov 17 20:35:58 2010
@@ -2072,6 +2072,9 @@
for (unsigned i = 1, e = Operands.size(); i != e; ++i)
assert(getEffectiveSCEVType(Operands[i]->getType()) == ETy &&
"SCEVAddRecExpr operand types don't match!");
+ for (unsigned i = 0, e = Operands.size(); i != e; ++i)
+ assert(Operands[i]->isLoopInvariant(L) &&
+ "SCEVAddRecExpr operand is not loop-invariant!");
#endif
if (Operands.back()->isZero()) {
More information about the llvm-branch-commits
mailing list