[llvm] r191200 - InstSimplify: Fold equality comparisons between non-inbounds GEPs.

Duncan Sands duncan.sands at gmail.com
Thu Sep 26 09:14:11 PDT 2013


Hi Benjamin,

>> Suppose this example was
>>   %x = getelementptr i64* %a, i64 4294967296
>> i.e. offset of 2^32.
>> On a 32 bit machine, %x is equal to %a, so the comparison should not be folded
>> to "false" on such machines.
>
> Yup, and accumulateConstantOffset does its computation in the intptr width and gets this right.

sounds good, I didn't realize that.  Thanks for explaining :)

  Your example is correctly folded to "true". Did you have another example where 
we get it wrong now?

Nope, I was just catching up with email and spotted this.

Ciao, Duncan.




More information about the llvm-commits mailing list