mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-05 03:36:43 +00:00
Preserve HasNSW and HasNUW when constructing SCEVs for Add and Mul
instructions. llvm-svn: 83606
This commit is contained in:
parent
10c870b46f
commit
e81a040ce7
@ -2951,12 +2951,20 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {
|
||||
|
||||
Operator *U = cast<Operator>(V);
|
||||
switch (Opcode) {
|
||||
case Instruction::Add:
|
||||
case Instruction::Add: {
|
||||
AddOperator *A = cast<AddOperator>(U);
|
||||
return getAddExpr(getSCEV(U->getOperand(0)),
|
||||
getSCEV(U->getOperand(1)));
|
||||
case Instruction::Mul:
|
||||
getSCEV(U->getOperand(1)),
|
||||
A->hasNoUnsignedWrap(),
|
||||
A->hasNoSignedWrap());
|
||||
}
|
||||
case Instruction::Mul: {
|
||||
MulOperator *M = cast<MulOperator>(U);
|
||||
return getMulExpr(getSCEV(U->getOperand(0)),
|
||||
getSCEV(U->getOperand(1)));
|
||||
getSCEV(U->getOperand(1)),
|
||||
M->hasNoUnsignedWrap(),
|
||||
M->hasNoSignedWrap());
|
||||
}
|
||||
case Instruction::UDiv:
|
||||
return getUDivExpr(getSCEV(U->getOperand(0)),
|
||||
getSCEV(U->getOperand(1)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user