[PATCH] D42989: [X86] When doing callee save/restore for k-registers make sure we don't use KMOVQ on non-BWI targets

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 15:45:52 PST 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, MatzeB, zvi.

If we are saving/restoring k-registers, the default behavior of getMinimalRegisterClass will find the VK64 class with a spill size of 64 bits. This will cause the KMOVQ opcode to be used for save/restore. If we don't have have BWI instructions we need to constrain the class returned to give us VK16 with a 16-bit spill size. We can do this by passing the either v16i1 or v64i1 into getMinimalRegisterClass.

Fixes PR36256


https://reviews.llvm.org/D42989

Files:
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86InstrInfo.cpp
  test/CodeGen/X86/avx512-intel-ocl.ll
  test/CodeGen/X86/x86-interrupt_cc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42989.133094.patch
Type: text/x-patch
Size: 5524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/14ce6971/attachment.bin>


More information about the llvm-commits mailing list