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

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 06:50:19 PST 2015


RKSimon added a comment.

In http://reviews.llvm.org/D15315#305248, @chenli wrote:

> 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.


I just want to make sure that you've been able to use this patch locally with a suitably updated http://reviews.llvm.org/D14603 to deal with the overflow test cases that we discussed.


http://reviews.llvm.org/D15315





More information about the llvm-commits mailing list