[PATCH] D144451: [X86] Optimize umax(X,1)

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:19:30 PST 2023


goldstein.w.n added a comment.

In D144451#4142230 <https://reviews.llvm.org/D144451#4142230>, @spatel wrote:

> This doesn't handle i8 and i16 the same way because truncates get in the way, right? Would it be better to match this as "umax(x, 1)"  (before it becomes x86-specific instructions)? Or could we peek through a truncate and still generate the `adc` for i8/i16?

I think there is potentially a bit of danger of transforming `umin` as other patterns seem more likely to look for `umin` than the alternative (select or x86adc).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144451



More information about the llvm-commits mailing list