[llvm-commits] [PATCH] GVN patch for overflow intrinsics

Lang Hames lhames at gmail.com
Fri Jul 8 01:04:09 PDT 2011


Hi Chris, Frits,

> I think that Owen is the best one to handle this.  In addition to handling
> the signed versions of these as well, does this correctly handle the case
> when the subtract comes first, and the cases when the overflow bit is
> actually used?
>
> I don't see any issues with the use/non-use of the overflow bit.  For the
> signed overflow versions, is it only the semantics of the overflow bit that
> are affected?  Is the value part of the result the same between sadd/uadd?


Yep - use/non-use of the overflow bit should be a non-issue with this patch.

Regarding the signed intrinsics: I've stayed conservative with this patch. I
haven't checked the signed intrinsics yet to address Owen's question (do the
semantics of the value parts change?). I'll try to find time for that
tomorrow.


> > In principle, we'd want to optimize:
> >
> > a = add i32 y, z
> > ...
> > b,c = addo(y,z)
> >
> > into:
> >
> > b,c = addo(y,z)
> > a = b
> > …
>
> I don't think this patch will currently do this.


No: This case won't be caught by my patch.

Committed on Owen's advice in r134677.

Cheers,
Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110708/cac56f29/attachment.html>


More information about the llvm-commits mailing list