[PATCH] D103820: [X86] Prefer vpmovq2m over vpternlogd + vpcmpgtq

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 10:14:54 PDT 2021


davezarzycki added a comment.

In D103820#2803182 <https://reviews.llvm.org/D103820#2803182>, @craig.topper wrote:

> In D103820#2803120 <https://reviews.llvm.org/D103820#2803120>, @davezarzycki wrote:
>
>> Actually, wait. Something weird is going on at the mid-level. These two functions should generate the same optimized IR, right?
>>
>>   typedef int V __attribute__((vector_size(64)));
>>   
>>   V lt_zero_x_y(V mask, V x, V y) { return mask <  0 ? x : y; }
>>   V ge_zero_y_x(V mask, V x, V y) { return mask >= 0 ? y : x; }
>
> I'm not sure we canonicalize select operand order.
>
> vpmovq2m only exists with avx512dq. Is this transform still useful with just avx512f?

On AVX512F? Sure. VPXOR has better code density than VPTERNLOG.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103820



More information about the llvm-commits mailing list