-
- Downloads
[TypePromotion] Extend TypePromotion::isSafeWrap
This modifies the preconditions of TypePromotion's isSafeWrap method, to allow it to work from all constants from the ICmp. Using the code: %a = add %x, C1 %c = icmp ult %a, C2 According to Alive, we can prove that is equivalent to icmp ult (add zext(%x), sext(C1)), zext(C2) given C1 <=s 0 and C1 >s C2. https://alive2.llvm.org/ce/z/CECYZB Which is similar to what is already present. We can also prove icmp ult (add zext(%x), sext(C1)), sext(C2) given C1 <=s 0 and C1 <=s C2. https://alive2.llvm.org/ce/z/KKgyeL The PrepareWrappingAdds method was removed, and the constants are now altered to sext or zext directly as required by the above methods. Differential Revision: https://reviews.llvm.org/D113678
Showing
- llvm/lib/CodeGen/TypePromotion.cpp 37 additions, 71 deletionsllvm/lib/CodeGen/TypePromotion.cpp
- llvm/test/CodeGen/AArch64/and-mask-removal.ll 1 addition, 2 deletionsllvm/test/CodeGen/AArch64/and-mask-removal.ll
- llvm/test/CodeGen/AArch64/typepromotion-overflow.ll 8 additions, 8 deletionsllvm/test/CodeGen/AArch64/typepromotion-overflow.ll
- llvm/test/Transforms/TypePromotion/ARM/casts.ll 2 additions, 2 deletionsllvm/test/Transforms/TypePromotion/ARM/casts.ll
- llvm/test/Transforms/TypePromotion/ARM/clear-structures.ll 3 additions, 3 deletionsllvm/test/Transforms/TypePromotion/ARM/clear-structures.ll
- llvm/test/Transforms/TypePromotion/ARM/icmps.ll 7 additions, 6 deletionsllvm/test/Transforms/TypePromotion/ARM/icmps.ll
- llvm/test/Transforms/TypePromotion/ARM/wrapping.ll 23 additions, 18 deletionsllvm/test/Transforms/TypePromotion/ARM/wrapping.ll
Loading
Please register or sign in to comment