[all-commits] [llvm/llvm-project] f6c7ba: [Win/x64] Update preserve_most to treat XMM regist...

Seth Brenith via All-commits all-commits at lists.llvm.org
Mon Dec 4 11:53:50 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6c7baea098aac03687f5041fc860ca95f070e4e
      https://github.com/llvm/llvm-project/commit/f6c7baea098aac03687f5041fc860ca95f070e4e
  Author: Seth Brenith <sethbrenith at users.noreply.github.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/lib/Target/X86/X86CallingConv.td
    M llvm/lib/Target/X86/X86RegisterInfo.cpp
    A llvm/test/CodeGen/X86/preserve_mostcc64_win.ll

  Log Message:
  -----------
  [Win/x64] Update preserve_most to treat XMM registers like C (#73866)

As [scottmcm
described](https://discourse.llvm.org/t/conv-c-and-conv-preservemost-mix-badly-on-windows-x64/73054),
the `preserve_most` calling convention, as currently implemented, is a
bad fit for Windows on x64. The intent of `preserve_most` is "to make
the code in the caller as unintrusive as possible", but `preserve_most`
causes the caller to spill and restore ten SIMD registers. It would be
preferable to make `preserve_most` treat the XMM registers however the C
calling convention does on the target operating system.

This is a breaking change, but the documentation indicates that
`preserve_most` is still experimental, so I believe that ABI
compatibility is not yet a requirement.




More information about the All-commits mailing list