Lines Matching refs:Overflow
940 // overflow. Hence, we must assure that the result of our computation is
974 // isn't smart enough to ignore the overflow, which leads to much less
992 // multiplying for calculating K! / 2^T to avoid overflow.
993 // Other overflow doesn't matter because we only care about the bottom
1051 // The computation is correct in the face of overflow provided that the
1149 // signed overflow as long as the value of the recurrence within the
1169 // unsigned overflow as long as the value of the recurrence within the loop does
1187 // Used to make code generic over signed and unsigned overflow.
1277 // "S+X does not sign/unsign-overflow".
1285 // 2. Direct overflow check on the step operation's expression.
1327 // Try to prove away overflow by looking at "nearby" add recurrences. A
1336 // If ({S-T,+,X} + T) does not overflow ... (1)
1340 // If {S-T,+,X} does not overflow ... (2)
1345 overflow ... (3)
1353 // (3) is implied by (1) -- "(S-T)+T does not overflow" is simply "({S-T,+,X}+T)
1354 // does not overflow" restricted to the 0th iteration. Therefore we only need
1444 // did not overflow the old, smaller, value, we can zero extend all of the
1459 // If we have special knowledge that this addrec won't overflow,
1477 // overflow.
1487 // Check whether Start+Step*MaxBECount has no unsigned overflow.
1523 // Normally, in the cases we can prove no-overflow via a
1528 // these to prove lack of overflow. Use this fact to avoid
1582 // If the addition does not unsign overflow then we can, by definition,
1662 // If the addition does not sign overflow then we can, by definition,
1671 // did not overflow the old, smaller, value, we can sign extend all of the
1686 // If we have special knowledge that this addrec won't overflow,
1704 // overflow.
1714 // Check whether Start+Step*MaxBECount has no signed overflow.
1757 // Normally, in the cases we can prove no-overflow via a
1762 // these to prove lack of overflow. Use this fact to avoid
1969 // can't-overflow flags for the operation if possible.
2000 // (A + C) --> (A + C)<nsw> if the addition does not sign overflow
2001 // (A + C) --> (A + C)<nuw> if the addition does not unsign overflow
2310 // outer add and the inner addrec are guaranteed to have no overflow.
2382 static uint64_t umul_ov(uint64_t i, uint64_t j, bool &Overflow) {
2384 if (j > 1 && k / j != i) Overflow = true;
2389 /// intermediate computation overflows, Overflow will be set and the return will
2390 /// be garbage. Overflow is not cleared on absence of overflow.
2391 static uint64_t Choose(uint64_t n, uint64_t k, bool &Overflow) {
2396 // integral result, and helps reduce the chance of overflow in the
2397 // intermediate computations. However, we can still overflow even when the
2408 r = umul_ov(r, n-(i-1), Overflow);
2565 // outer mul and the inner addrec are guaranteed to have no overflow.
2607 bool Overflow = false;
2612 OtherAddRec->getNumOperands() - 1; x != xe && !Overflow; ++x) {
2614 for (int y = x, ye = 2*x+1; y != ye && !Overflow; ++y) {
2615 uint64_t Coeff1 = Choose(x, 2*x - y, Overflow);
2618 z < ze && !Overflow; ++z) {
2619 uint64_t Coeff2 = Choose(2*x - y, x-z, Overflow);
2622 Coeff = umul_ov(Coeff1, Coeff2, Overflow);
2633 if (!Overflow) {
2981 // flow and the no-overflow bits may not be valid for the expression in any
3882 // CI are guarded by the overflow check, we can go ahead and pretend
3992 // about signed or unsigned overflow because pointers are
4020 // overflow.
4609 // Check for overflow. This must be done with ConstantRange arithmetic
4610 // because we could be called from within the ScalarEvolution overflow
4625 // Check for unsigned overflow.
4644 // Check for signed overflow. This must be done with ConstantRange
4646 // overflow checking code.
5270 // In case of integer overflow, this returns 0, which is correct.
7113 // For positive steps (counting up until unsigned overflow):
8329 // [*]: (1) can be proved by ruling out overflow.
8339 // s< (INT_MIN - C). Lack of sign overflow / underflow in "FoundRHS + C" is
8590 // SMaxRHS + SMaxStrideMinusOne > SMaxValue => overflow!
8599 // UMaxRHS + UMaxStrideMinusOne > UMaxValue => overflow!
8616 // SMinRHS - SMaxStrideMinusOne < SMinValue => overflow!
8625 // UMinRHS - UMaxStrideMinusOne < UMinValue => overflow!
8666 // Avoid proven overflow cases: this will ensure that the backedge taken count
8667 // will not generate any unsigned overflow. Relaxed no-overflow conditions
8741 // Avoid proven overflow cases: this will ensure that the backedge taken count
8742 // will not generate any unsigned overflow. Relaxed no-overflow conditions
8809 // Otherwise, we cannot determine the overflow conditions.