[PATCH] D151182: [LegalizeTypes][ARM][AArch6][RISCV][VE][WebAssembly] Add special case for smin(X, -1) and smax(X, 0) to ExpandIntRes_MINMAX.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 11:20:13 PDT 2023


efriedma added a comment.

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.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151182



More information about the llvm-commits mailing list