HomePhabricator

[X86][AVX512] Avoid bitcasts between scalar and vXi1 bool vectors

Authored by RKSimon on Jun 11 2020, 2:22 AM.

Description

[X86][AVX512] Avoid bitcasts between scalar and vXi1 bool vectors

AVX512 mask types are often bitcasted to scalar integers for various ops before being bitcast back to be used as a predicate. In many cases we can avoid these KMASK<->GPR transfers and perform equivalent operations on the mask unit.

If the destination mask type is legal, and we can confirm that the scalar op originally came from a mask/vector/float/double type then we should try to avoid the scalar entirely.

This avoids some codegen issues noticed while working on PTEST/MOVMSK improvements.

Partially fixes PR32547 - we don't create a KUNPCK yet, but OR(X,KSHIFTL(Y)) can be handled in a separate patch.

Differential Revision: https://reviews.llvm.org/D81548

Details

Committed
RKSimonJun 11 2020, 2:22 AM
Differential Revision
D81548: [X86][AVX512] Avoid bitcasts between scalar and vXi1 bool vectors
Parents
rGb651f67db8cc: [X86][AVX512] Add test case for PR32547
Branches
Unknown
Tags
Unknown