mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 12:24:34 +00: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:
parent
0d9583aa41
commit
6039769dc1
@ -1074,6 +1074,9 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
|
||||
if (L->contains(User.Inst->getParent()))
|
||||
User.Inst->moveBefore(LatchBlock->getTerminator());
|
||||
}
|
||||
if (RewriteOp->getType() != ReplacedTy)
|
||||
RewriteOp = SCEVExpander::InsertCastOfTo(RewriteOp, ReplacedTy);
|
||||
|
||||
SCEVHandle RewriteExpr = SCEVUnknown::get(RewriteOp);
|
||||
|
||||
// Clear the SCEVExpander's expression map so that we are guaranteed
|
||||
|
Loading…
x
Reference in New Issue
Block a user