[all-commits] [llvm/llvm-project] 4a65a8: [NFC][AMDGPU] Add test showing caller/callee SGPR ...

Shilei Tian via All-commits all-commits at lists.llvm.org
Mon Feb 23 07:35:02 PST 2026


  Branch: refs/heads/users/shiltian/test-for-inreg-argument-caller-callee-mismatch
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a65a8040fead5bb7dae4af13f1e6c22ef0e8aef
      https://github.com/llvm/llvm-project/commit/4a65a8040fead5bb7dae4af13f1e6c22ef0e8aef
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2026-02-23 (Mon, 23 Feb 2026)

  Changed paths:
    A llvm/test/CodeGen/AMDGPU/cc-inreg-sgpr0-3-mismatch.ll

  Log Message:
  -----------
  [NFC][AMDGPU] Add test showing caller/callee SGPR mismatch for inreg args

Add a test demonstrating a bug where the caller and callee disagree on which
SGPRs hold user inreg arguments when there are enough to reach the SGPR0-3
range.

On the callee side, `LowerFormalArguments` marks SGPR0-3 as allocated in
`CCState` before the CC analysis runs. On the caller side, `LowerCall` adds the
scratch resource to `RegsToPass` without marking SGPR0-3 in `CCState`. This
causes `CC_AMDGPU_Func` to assign user inreg args to SGPR0-3 on the caller side
(they appear free) while the callee skips them.

In the test, the caller writes arg 0 (value 42) to s0, but the callee reads arg
0 from s16.



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