[all-commits] [llvm/llvm-project] 2068b1: [X86] Fix ABI for passing after i128 (#124134)

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jan 24 06:32:15 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2068b1ba031e258a6448bea372005d19692c802a
      https://github.com/llvm/llvm-project/commit/2068b1ba031e258a6448bea372005d19692c802a
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86CallingConv.cpp
    M llvm/lib/Target/X86/X86CallingConv.td
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/lib/Target/X86/X86ISelLoweringCall.cpp
    M llvm/test/CodeGen/X86/addcarry.ll
    M llvm/test/CodeGen/X86/apx/flags-copy-lowering.ll
    M llvm/test/CodeGen/X86/avgflooru-i128.ll
    M llvm/test/CodeGen/X86/fmuladd-soft-float.ll
    M llvm/test/CodeGen/X86/i128-abi.ll
    M llvm/test/CodeGen/X86/sadd_sat_vec.ll
    M llvm/test/CodeGen/X86/ssub_sat_vec.ll
    M llvm/test/CodeGen/X86/subcarry.ll
    M llvm/test/CodeGen/X86/uadd_sat_vec.ll
    M llvm/test/CodeGen/X86/usub_sat_vec.ll

  Log Message:
  -----------
  [X86] Fix ABI for passing after i128 (#124134)

If we're passing an i128 value and we no longer have enough argument
registers (only r9 unallocated), the value gets passed via the stack.
However, r9 is still allocated as a shadow register, which means that a
following i64 argument will not use it. This doesn't match the x86-64
psABI.

Fix this by making i128 arguments as requiring consecutive registers,
and then adding a custom CC lowering that will allocate both parts of
the i128 at the same time, either to register or to stack, without
reserving a shadow register.

Fixes https://github.com/llvm/llvm-project/issues/123935.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list