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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 04:52:54 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: craig.topper, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

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,KSHIFTR(Y) will be handled in a separate patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81548

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/avx512-intrinsics.ll
  llvm/test/CodeGen/X86/pr41619.ll
  llvm/test/CodeGen/X86/vector-shuffle-v1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81548.269793.patch
Type: text/x-patch
Size: 9363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200610/dab5d83d/attachment.bin>


More information about the llvm-commits mailing list