1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

RewriteExpr, either the new PHI node of induction variable or the

post-increment value, should be first cast to the appropriated type (to the
type of the common expr). Otherwise, the rewrite of a use based on (common +
iv) may end up with an incorrect type.

llvm-svn: 28735
This commit is contained in:
Evan Cheng 2006-06-09 00:12:42 +00:00
parent 0d9583aa41
commit 6039769dc1

View File

@ -1074,6 +1074,9 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
if (L->contains(User.Inst->getParent())) if (L->contains(User.Inst->getParent()))
User.Inst->moveBefore(LatchBlock->getTerminator()); User.Inst->moveBefore(LatchBlock->getTerminator());
} }
if (RewriteOp->getType() != ReplacedTy)
RewriteOp = SCEVExpander::InsertCastOfTo(RewriteOp, ReplacedTy);
SCEVHandle RewriteExpr = SCEVUnknown::get(RewriteOp); SCEVHandle RewriteExpr = SCEVUnknown::get(RewriteOp);
// Clear the SCEVExpander's expression map so that we are guaranteed // Clear the SCEVExpander's expression map so that we are guaranteed