[LLVMdev] "icmp sgt" when it should be "ugt" ?
eli.friedman at gmail.com
Tue Aug 2 11:31:06 CDT 2011
On Tue, Aug 2, 2011 at 8:53 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Eli,
>>>> Icmp sgt is correct.
>>> while ugt would be wrong, I think sgt is too!
>>> For example, suppose %buf is 0 and %bufLen is ~0U. Then %add.ptr is ~0U,
>>> %cmp is true, so control branches to %if.then. However in the optimized
>>> %cmp is false and control branches to %if.end.
>>> The GEP does have an inbounds attribute, I'm not sure if that is relevant
>> It is relevant: in your proposed scenario, the GEP returns undef.
> by the way, is GEP arithmetic supposed to be signed or unsigned?
Signed; is that really not stated anywhere in LangRef?
More information about the LLVMdev