[PATCH] D144451: [X86] Optimize umax(X,1)
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 21 14:37:42 PST 2023
goldstein.w.n added a comment.
In D144451#4142412 <https://reviews.llvm.org/D144451#4142412>, @goldstein.w.n wrote:
> 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).
Looking a little more, think you're right, best to do this in `LowerSELECT` before the `X86ISD::CMOV` logic.
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