Lines Matching refs:Overflow
508 /// to generate the first by knowing that pointer arithmetic doesn't overflow.
857 // overflow.
908 // can't have overflow on either side. We can therefore re-write
926 // GEP is inbounds, the final add of the base pointer can have signed overflow
942 // know pointers can't overflow since the gep is inbounds. See if we can
1205 return nullptr; // The overflow computation also screws up here
1236 // overflow variable is set to 0 if it's corresponding bound variable is valid
1252 // Can't overflow. e.g. X/2 op 0 --> [-1, 2)
1277 HiOverflow = 1; // [INTMIN+1, overflow)
2117 // checked. If there is an overflow on the low or high side, remember
2493 /// Then replace it with llvm.sadd.with.overflow.i8.
2499 // llvm.sadd.with.overflow. To do this, we have to replace the original add
2508 // If CI2 is 2^7, 2^15, 2^31, then it might be an sadd.with.overflow.
2521 // This is only really a signed overflow check if the inputs have been
2530 // llvm.sadd.with.overflow, the only uses allowed are the add-with-constant
2549 // result and the overflow bit.
2570 // The original icmp gets replaced with the overflow value.
2571 return ExtractValueInst::Create(Call, 1, "sadd.overflow");
2576 Value *&Result, Constant *&Overflow) {
2582 Overflow = OverflowVal;
2588 // If the overflow check was an add followed by a compare, the insertion point
2596 llvm_unreachable("bad overflow check kind!");
2614 // that it will never overflow.
2672 /// overflow.
2676 /// The function checks if this is a test for overflow and if so replaces
2677 /// multiplication with call to 'mul.with.overflow' intrinsic.
2705 // Calculate type and width of the result produced by mul.with.overflow.
2719 // In order to replace the original mul with a narrower mul.with.overflow,
2721 // bits must be not greater than the width of mul.with.overflow.
2831 // Replace: mul(zext A, zext B) --> mul.with.overflow(A, B)
2844 // mul.with.overflow and adjust properly mask/size.
2857 // Replace (mul & mask) --> zext (mul.with.overflow & short_mask)
2874 // The original icmp gets replaced with the overflow value, maybe inverted
3250 // overflow-safe integer arithmetic function. The source performs an
3251 // addition in wider type, and explicitly checks for overflow using
3255 // TODO: This could probably be generalized to handle other overflow-safe
3260 // if (sum+128 >u 255) ... -> llvm.sadd.with.overflow.i8
3820 // icmp (X+Y), X -> icmp Y, 0 for equalities or if there is no overflow.
3825 // icmp X, (X+Y) -> icmp 0, Y for equalities or if there is no overflow.
3830 // icmp (X+Y), (X+Z) -> icmp Y, Z for equalities or if there is no overflow.
3942 // icmp (X-Y), X -> icmp 0, Y for equalities or if there is no overflow.
3946 // icmp X, (X-Y) -> icmp Y, 0 for equalities or if there is no overflow.
3950 // icmp (Y-X), (Z-X) -> icmp Y, Z for equalities or if there is no overflow.
3956 // icmp (X-Y), (X-Z) -> icmp Z, Y for equalities or if there is no overflow.
4113 Constant *Overflow;
4115 Overflow)) {
4117 return replaceInstUsesWith(I, Overflow);
4121 // (zext a) * (zext b) --> llvm.umul.with.overflow.