commit | 0cbe91ba3bd84a5ef68a1d0de5df6e955690b0a4 | [log] [tgz] |
---|---|---|
author | Dan Gohman <gohman@apple.com> | Wed Mar 02 01:34:10 2011 +0000 |
committer | Dan Gohman <gohman@apple.com> | Wed Mar 02 01:34:10 2011 +0000 |
tree | 70b49aa1042c0fade036961d38957c37e3e26e66 | |
parent | f06e6c2ba717429936908254d53fa579bc941388 [diff] [blame] |
Don't re-use existing addrec expansions if they contain casts. This fixes PR9259. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126812 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index b7c110f..f2d23c4 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -858,7 +858,8 @@ // loop already visited by LSR for example, but it wouldn't have // to be. do { - if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV)) { + if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) || + isa<CastInst>(IncV)) { IncV = 0; break; }