When decling to reuse existing expressions that involve casts, ignore
[oota-llvm.git] / lib / Analysis / ScalarEvolutionExpander.cpp
index f2d23c4be7085a553ae770d7f04b01a3506391eb..76a94ea274673bb816a1c7cec385e649dbdd42d5 100644 (file)
@@ -859,7 +859,7 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
         // to be.
         do {
           if (IncV->getNumOperands() == 0 || isa<PHINode>(IncV) ||
-              isa<CastInst>(IncV)) {
+              (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV))) {
             IncV = 0;
             break;
           }