[PATCH] D142254: [X86] Transform vector SET{LE/ULT/ULE} -> SETLT and SET{GE/UGT/UGE} -> SETGT if possible

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 18:36:24 PST 2023


goldstein.w.n added a comment.

In D142254#4070389 <https://reviews.llvm.org/D142254#4070389>, @lebedev.ri wrote:

> In D142254#4070376 <https://reviews.llvm.org/D142254#4070376>, @goldstein.w.n wrote:
>
>> In D142254#4070259 <https://reviews.llvm.org/D142254#4070259>, @RKSimon wrote:
>>
>>> This feels like we could easily make this a generic DAG fold with a suitable TLI callback to help determine the preferred CondCode (or just signed/unsigned).
>>
>> What where you thinking the API would be? I can see it being easy to represent "prefered signed/unsigned" but have trouble seeing a clean and generic
>> API for only if `LT`/`GT` but NOT for `LE`/`GE`.
>
> Sounds like the hook should just take the current CC and return the preferred one?

Sure but I'm not sure how you would write it w.o expanding every case ( {sources} X {targets} ) which I'm not sure would be clean.
Signed/unsigned wouldn't be too hard, but that could end up de-optimizing b.c something like `sle` is less useful than `ule` for analysis
and on something like x86 has no codegen benefit.

Maybe you could get away with 4x combinations of PreferSigned X PreferWithEq


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142254



More information about the llvm-commits mailing list