[PATCH] D108887: [X86][MS] Fix the aligement mismatch of vector variable arguments on Win32

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 29 00:53:09 PDT 2021


pengfei created this revision.
pengfei added reviewers: rnk, LiuChen3, LuoYuanke.
Herald added subscribers: hiraditya, qcolombet.
pengfei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The alignment of vector variable arguments in callee side is 4, which is
aligned with MSVC. But the caller aligns them to the size of vector
arguments. It results in run fails. This patch fixes this problem by
trimming it to 4 bytes for variable arguments on Win32.

Fixed vector arguments are passed by pointer on Win32. So they don't have
the problem.

I don't find a doc in MSDN for this calling conversion, so I did several
experiments here: https://godbolt.org/z/n1zn1Gx1z


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108887

Files:
  llvm/lib/Target/X86/X86CallingConv.td
  llvm/test/CodeGen/X86/vaargs-win32.ll
  llvm/test/CodeGen/X86/win32-spill-xmm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108887.369310.patch
Type: text/x-patch
Size: 4177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210829/99b8bbb7/attachment.bin>


More information about the llvm-commits mailing list