summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-02-26 19:48:16 +0000
committerReid Kleckner <rnk@google.com>2019-02-26 19:48:16 +0000
commit8fda7e15e6249d675b6852c60ab191b3e3cda8ba (patch)
tree75a700d50d82b40702b1b24cbb455ab250685fc2 /llvm/lib
parent6d6afb72b3a2c8b85c3c6e3acd39d96baa6e443e (diff)
downloadbcm5719-llvm-8fda7e15e6249d675b6852c60ab191b3e3cda8ba.tar.gz
bcm5719-llvm-8fda7e15e6249d675b6852c60ab191b3e3cda8ba.zip
[X86] Fix bug in vectorcall calling convention
Original implementation can't correctly handle __m256 and __m512 types passed by reference through stack. This patch fixes it. Patch by Wei Xiao! Differential Revision: https://reviews.llvm.org/D57643 llvm-svn: 354921
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86CallingConv.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86CallingConv.cpp b/llvm/lib/Target/X86/X86CallingConv.cpp
index 9be1147df3c..aee344a2676 100644
--- a/llvm/lib/Target/X86/X86CallingConv.cpp
+++ b/llvm/lib/Target/X86/X86CallingConv.cpp
@@ -162,7 +162,10 @@ static bool CC_X86_64_VectorCall(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
// created on top of the basic 32 bytes of win64.
// It can happen if the fifth or sixth argument is vector type or HVA.
// At that case for each argument a shadow stack of 8 bytes is allocated.
- if (Reg == X86::XMM4 || Reg == X86::XMM5)
+ const TargetRegisterInfo *TRI =
+ State.getMachineFunction().getSubtarget().getRegisterInfo();
+ if (TRI->regsOverlap(Reg, X86::XMM4) ||
+ TRI->regsOverlap(Reg, X86::XMM5))
State.AllocateStack(8, 8);
if (!ArgFlags.isHva()) {
OpenPOWER on IntegriCloud