We have some recognition of SSAT and USAT from SELECT_CC at the moment. This extends the matching to SMIN/SMAX which can help catch more cases, either from min/max being the canonical form in instcombine or from some expanded nodes like fp_to_si_sat.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for taking a look.
llvm/lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
1571 | The code tries to match min(max(..)) or max(min(..)), providing the bounds are correct. Both seem to come up in practice, from the tests we have. There is some code in PerformMinMaxToSatCombine that swaps the min and max nodes if it needs to. | |
17566 | Oh yeah, will fix. | |
17615 | The rest of this function looks at vectors under MVE. VQDMULH is only an MVE vector operation, so won't do anything for i32. |
I was just curious if we need to set a target combine for SMAX given that SMIN is the root of the node that we are matching; don't know how that works exactly...