[PATCH] D15315: [X86ISelLowering] Replace uint64_t with APInt to prevent overflow

Chen Li via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 13:56:54 PST 2015


chenli added a comment.

In http://reviews.llvm.org/D15315#304816, @RKSimon wrote:

> Just to be clear - APInt operators don't prevent or assert on overflow, it just provides *_ov methods that make it easier to recognise when overflow occurs. Please can you confirm that this approach will work for http://reviews.llvm.org/D14603?


No, it doesn't prevent overflow. But APInt makes it easy to add checks of MulAmt + 1 and MulAmt - 1 in http://reviews.llvm.org/D14603 as you mentioned. 
What do you mean by confirming this works for http://reviews.llvm.org/D14603? I think I need to modify http://reviews.llvm.org/D14603 once this get checked in and add new test cases to show overflow doesn't happen.


http://reviews.llvm.org/D15315





More information about the llvm-commits mailing list