[PATCH] D51929: [DAGCombiner] use UADDO to optimize saturated unsigned add

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 12:47:50 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D51929#1242320, @lebedev.ri wrote:

> In https://reviews.llvm.org/D51929#1242305, @spatel wrote:
>
> > I'm not following the 'adc' suggestion though. That uses the carry from a previous op in the addition. What would that code sequence look like?
>
>
> Uhm, after thinking a bit more, i think we'd only care about `ADD`? I haven't really thought about it though.
>  But in `ADC` case, i guess the same as with `ADD`, but prefixed with `CLC` <https://www.felixcloutier.com/x86/CLC.html> -> no point in using `ADC` in the first place.


For completeness sake, i was *thinking* of something like: https://godbolt.org/z/uoShW6
But it is totally possible that it makes no sense :)


https://reviews.llvm.org/D51929





More information about the llvm-commits mailing list