[llvm-commits] RFC: patch for PR1782 (BasicAliasAnalyis)

Chris Lattner clattner at apple.com
Thu Dec 13 16:24:43 PST 2007


>>> I guess, such a large positive index in GEP as seen above can be
>>> introduced by -instcombine pass.
>>
>> Ok.  This is somewhat dubious though, as it is wrapping around the  
>> end
>> of the address space which is undefined in C.
>
> I've found one place in instcombine, where something like this can be
> introduced. Fixed with this patch:
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- 
> Mon-20071210/056253.html

I agree, that is definitely an instcombine bug, thanks!

>>> I think, the simplest way to fix it is to truncate the computed  
>>> offset
>>> to the target pointer size before returning it in
>>> TargetData::getIndexedOffset(). If you think this is the correct
>>> approach, I may prepare a patch.
>>
>> Ah, that does make a lot of sense.  Since the fix is simple,  
>> please go
>> for it!
>
> I've rethought the issue. If you say that, wrapping around the  
> memory by
> getelementptr is undefined, I think it's better to leave it as it is.
> This way we'll be able to catch other optimizer bugs, if there are any
> of the above kind.

Excellent, thanks!

-Chris




More information about the llvm-commits mailing list