Ternary expression checks for ISD::ADD instead of ISD::UADDO inside DAGTypeLegalizer::ExpandIntRes_UADDSUBO.
This means the ternary expression will evaluate to ISD::SUBCARRY for both ISD::UADDO and ISD::USUBO nodes.
Targets are likely to implement both, so impact will be very limited in practice.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
As this would only affect a hypothetical target that supports ISD::SUBCARRY but not ISD::ADDCARRY, testing this via IR would seem overkill.
I think the correct level of testing for this would be UT for DAGTypeLegalizer, but the closest thing I could find was some of the things under llvm/unittests/CodeGen, like AArch64SelectionDAGTest.cpp.
Does that sound like it's in the right direction?
Two remarks:
- Code duplication
- If this is purely theoretical, can the dead code be simply dropped?
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | ||
---|---|---|
2306–2307 | this | |
2335–2336 | this | |
2343–2344 | and this do basically the same thing. |
I failed to mention during the review that I don't have commit access, so could anyone commit this on my behalf?
Right.
Now that we have migrated to git, can you paste your Author: name <e@ma.il> that should be used for the patch?
this