[all-commits] [llvm/llvm-project] 9d7d34: [X86][MS] Fix the aligement mismatch of vector var...

Pengfei Wang via All-commits all-commits at lists.llvm.org
Tue Sep 7 18:27:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d7d34c7691ad89cb0d7529e6a0064026acd6dca
      https://github.com/llvm/llvm-project/commit/9d7d34c7691ad89cb0d7529e6a0064026acd6dca
  Author: Wang, Pengfei <pengfei.wang at intel.com>
  Date:   2021-09-08 (Wed, 08 Sep 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86CallingConv.td
    A llvm/test/CodeGen/X86/vaargs-win32.ll
    M llvm/test/CodeGen/X86/win32-spill-xmm.ll

  Log Message:
  -----------
  [X86][MS] Fix the aligement mismatch of vector variable arguments on Win32

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

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D108887




More information about the All-commits mailing list