aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 9300de1..bdf31f9 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -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)));