Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:Overflow

501 /// to generate the first by knowing that pointer arithmetic doesn't overflow.
604 // GEP is inbounds, the final add of the base pointer can have signed overflow
620 // know pointers can't overflow since the gep is inbounds. See if we can
879 return nullptr; // The overflow computation also screws up here
910 // overflow variable is set to 0 if it's corresponding bound variable is valid
926 // Can't overflow. e.g. X/2 op 0 --> [-1, 2)
951 HiOverflow = 1; // [INTMIN+1, overflow)
1772 // checked. If there is an overflow on the low or high side, remember
2135 /// Then replace it with llvm.sadd.with.overflow.i8.
2141 // llvm.sadd.with.overflow. To do this, we have to replace the original add
2150 // If CI2 is 2^7, 2^15, 2^31, then it might be an sadd.with.overflow.
2163 // This is only really a signed overflow check if the inputs have been
2172 // llvm.sadd.with.overflow, the only uses allowed are the add-with-constant
2191 // result and the overflow bit.
2212 // The original icmp gets replaced with the overflow value.
2213 return ExtractValueInst::Create(Call, 1, "sadd.overflow");
2218 Value *&Result, Constant *&Overflow) {
2224 Overflow = OverflowVal;
2230 // If the overflow check was an add followed by a compare, the insertion point
2238 llvm_unreachable("bad overflow check kind!");
2256 // that it will never overflow.
2314 /// overflow.
2318 /// The function checks if this is a test for overflow and if so replaces
2319 /// multiplication with call to 'mul.with.overflow' intrinsic.
2347 // Calculate type and width of the result produced by mul.with.overflow.
2361 // In order to replace the original mul with a narrower mul.with.overflow,
2363 // bits must be not greater than the width of mul.with.overflow.
2473 // Replace: mul(zext A, zext B) --> mul.with.overflow(A, B)
2486 // mul.with.overflow and adjust properly mask/size.
2499 // Replace (mul & mask) --> zext (mul.with.overflow & short_mask)
2516 // The original icmp gets replaced with the overflow value, maybe inverted
2837 // overflow-safe integer arithmetic function. The source performs an
2838 // addition in wider type, and explicitly checks for overflow using
2842 // TODO: This could probably be generalized to handle other overflow-safe
2847 // if (sum+128 >u 255) ... -> llvm.sadd.with.overflow.i8
3368 // icmp (X+Y), X -> icmp Y, 0 for equalities or if there is no overflow.
3373 // icmp X, (X+Y) -> icmp 0, Y for equalities or if there is no overflow.
3378 // icmp (X+Y), (X+Z) -> icmp Y, Z for equalities or if there is no overflow.
3483 // icmp (X-Y), X -> icmp 0, Y for equalities or if there is no overflow.
3487 // icmp X, (X-Y) -> icmp Y, 0 for equalities or if there is no overflow.
3491 // icmp (Y-X), (Z-X) -> icmp Y, Z for equalities or if there is no overflow.
3497 // icmp (X-Y), (X-Z) -> icmp Z, Y for equalities or if there is no overflow.
3654 Constant *Overflow;
3656 Overflow)) {
3658 return ReplaceInstUsesWith(I, Overflow);
3662 // (zext a) * (zext b) --> llvm.umul.with.overflow.