We can compute a simpler expression for Lo for these cases. This
is an alternative for the test cases in D151180 that works for
more targets.
I view this as similar to some of the special cases we
have for expanding setcc operands.
Paths
| Differential D151182
[LegalizeTypes][ARM][AArch6][RISCV][VE][WebAssembly] Add special case for smin(X, -1) and smax(X, 0) to ExpandIntRes_MINMAX. ClosedPublic Authored by craig.topper on May 23 2023, 12:25 AM.
Details Summary We can compute a simpler expression for Lo for these cases. This I view this as similar to some of the special cases we
Diff Detail
Event TimelineThis revision is now accepted and ready to land.May 23 2023, 8:59 AM Closed by commit rG139392c0a580: [LegalizeTypes][ARM][AArch6][RISCV][VE][WebAssembly] Add special case for smin… (authored by craig.topper). · Explain WhyMay 23 2023, 9:21 AM This revision was automatically updated to reflect the committed changes. Comment Actions The default lowering here is weird. It appears to be written to minimize the latency of the high half of the result, which is not useful in most cases. I expect that it would be more efficient in most cases to expand to "a < b ? a : b", which can use the same condition to select both the high and low halves. Particularly on targets that have an efficient SETCCCARRY.
Revision Contents
Diff 524763 llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/AArch64/fpclamptosat.ll
llvm/test/CodeGen/AArch64/fpclamptosat_vec.ll
llvm/test/CodeGen/ARM/fpclamptosat.ll
llvm/test/CodeGen/ARM/fpclamptosat_vec.ll
llvm/test/CodeGen/RISCV/fpclamptosat.ll
llvm/test/CodeGen/RISCV/min-max.ll
llvm/test/CodeGen/RISCV/rvv/fpclamptosat_vec.ll
llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
llvm/test/CodeGen/VE/Scalar/smax.ll
llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
|