Fix Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll

llvm-svn: 22797
This commit is contained in:
Chris Lattner 2005-08-16 00:37:01 +00:00
parent 3cf8ef170a
commit e515416396
1 changed files with 3 additions and 2 deletions

View File

@ -347,8 +347,9 @@ replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
// This recurrence is invariant w.r.t to QueryLoop iff QueryLoop doesn't
// contain L.
return !QueryLoop->contains(L->getHeader());
// contain L and if the start is invariant.
return !QueryLoop->contains(L->getHeader()) &&
getOperand(0)->isLoopInvariant(QueryLoop);
}