File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ static bool refineInstruction(SCCPSolver &Solver,
120120 };
121121
122122 if (isa<OverflowingBinaryOperator>(Inst)) {
123+ if (Inst.hasNoSignedWrap () && Inst.hasNoUnsignedWrap ())
124+ return false ;
125+
123126 auto RangeA = GetRange (Inst.getOperand (0 ));
124127 auto RangeB = GetRange (Inst.getOperand (1 ));
125128 if (!Inst.hasNoUnsignedWrap ()) {
@@ -147,6 +150,9 @@ static bool refineInstruction(SCCPSolver &Solver,
147150 Changed = true ;
148151 }
149152 } else if (TruncInst *TI = dyn_cast<TruncInst>(&Inst)) {
153+ if (TI->hasNoSignedWrap () && TI->hasNoUnsignedWrap ())
154+ return false ;
155+
150156 auto Range = GetRange (Inst.getOperand (0 ));
151157 uint64_t DestWidth = TI->getDestTy ()->getScalarSizeInBits ();
152158 if (!TI->hasNoUnsignedWrap ()) {
You can’t perform that action at this time.
0 commit comments