[all-commits] [llvm/llvm-project] 8149cb: [RISCV] Implement getIPRACSRegs hook (#125586)

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Tue Feb 4 05:03:04 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8149cbfecdaf0ac8e5a9f38a87f30c89ddc001a4
      https://github.com/llvm/llvm-project/commit/8149cbfecdaf0ac8e5a9f38a87f30c89ddc001a4
  Author: Mikhail R. Gadelha <mikhail at igalia.com>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVCallingConv.td
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.h
    M llvm/test/CodeGen/RISCV/ipra.ll

  Log Message:
  -----------
  [RISCV] Implement getIPRACSRegs hook (#125586)

Fixes #124932.

This patch implements the getIPRACSRegs hook for RISC-V, similar to its introduction for x86 in commit 14b567d. This hook is necessary for correct code generation when Interprocedural Register Allocation (IPRA) is enabled, ensuring that the return address register (ra / x1) is correctly saved and restored when needed.

Unlike the x86 implementation, this patch only saves ra and does not yet include the frame pointer (fp). Further investigation is required to determine whether fp should also be preserved in all cases.

The test case is representative of a miscompile observed in the GCC torture suite (20090113-3.c), though similar failures occur in SPEC’s xz benchmark.



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