[PATCH] D133471: [DAGCombiner][X86] Fold (sub (subcarry X, 0, Carry), Y) -> (subcarry X, Y, Carry)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 08:59:23 PDT 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

In D133471#3777372 <https://reviews.llvm.org/D133471#3777372>, @craig.topper wrote:

> In D133471#3777069 <https://reviews.llvm.org/D133471#3777069>, @spatel wrote:
>
>> Is the transform still profitable if the subcarry has another use? (not sure how to write a test for that)
>
> I copied this code from visitAddLikeCommutative and changed ADDCARRY to SUBCARRY. So any one uses check is also missing there.

I see...that goes back to D32738 <https://reviews.llvm.org/D32738>. I'd put the one-use limit on both as a conservative first step unless there's a test showing this way is better.

LGTM, but let's see if @deadalnix has any suggestions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133471/new/

https://reviews.llvm.org/D133471



More information about the llvm-commits mailing list