[PATCH] D75154: [X86] Convert vXi1 vectors to xmm/ymm/zmm types via getRegisterTypeForCallingConv rather than using CCPromoteToType in the td file

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 21:22:05 PST 2020


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

Previously we tried to promote these to xmm/ymm/zmm by promoting
in the X86CallingConv.td file. But this breaks when we run out
of xmm/ymm/zmm registers and need to fall back to memory. We end
up trying to create a non-sensical scalar to vector. This lead
to an assertion. The new tests in avx512-calling-conv.ll all
trigger this assertion.

Since we really want to treat these types like we do on avx2,
it seems better to promote them before the calling convention
code gets involved. Except when the calling convention is one
that passes the vXi1 type in a k register.

The changes in avx512-regcall-Mask.ll are because we indicated
that xmm/ymm/zmm types should be passed indirectly for the
Win64 ABI before we go to the common lines that promoted the
vXi1 types. This caused the promoted types to be picked up by
the default calling convention code. Now we promote them earlier
so they get passed indirectly as though they were xmm/ymm/zmm.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75154

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/avx512-calling-conv.ll
  llvm/test/CodeGen/X86/avx512-regcall-Mask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75154.246626.patch
Type: text/x-patch
Size: 32894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200226/fb4c9187/attachment.bin>


More information about the llvm-commits mailing list