Fixes PR57576.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Is the transform still profitable if the subcarry has another use? (not sure how to write a test for that)
In IR, it looks like we'd reduce the equivalent of "subcarry X, 0, Carry" to "usubo X, Carry". Are those the same semantics for this node? And would that simpler transform make sense in SDAG too?
I copied this code from visitAddLikeCommutative and changed ADDCARRY to SUBCARRY. So any one uses check is also missing there.
In IR, it looks like we'd reduce the equivalent of "subcarry X, 0, Carry" to "usubo X, Carry". Are those the same semantics for this node? And would that simpler transform make sense in SDAG too?
Carry here has bool type so I don't think we can fold it to "usubo X, Carry" without an extend.
I see...that goes back to 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.