[all-commits] [llvm/llvm-project] 6a01b1: [AMDGPU] Fix caller/callee mismatch in SGPR assign...
Shilei Tian via All-commits
all-commits at lists.llvm.org
Sun Feb 22 08:51:37 PST 2026
Branch: refs/heads/users/shiltian/fix-inreg-argument-caller-callee-mismatch
Home: https://github.com/llvm/llvm-project
Commit: 6a01b19ff3be0aea9707292bcd29951e57395ada
https://github.com/llvm/llvm-project/commit/6a01b19ff3be0aea9707292bcd29951e57395ada
Author: Shilei Tian <i at tianshilei.me>
Date: 2026-02-22 (Sun, 22 Feb 2026)
Changed paths:
M llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
M llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-call.ll
M llvm/test/CodeGen/AMDGPU/call-args-inreg-bfloat.ll
M llvm/test/CodeGen/AMDGPU/call-args-inreg-no-sgpr-for-csrspill-xfail.ll
M llvm/test/CodeGen/AMDGPU/call-args-inreg.ll
M llvm/test/CodeGen/AMDGPU/cc-inreg-sgpr0-3-mismatch.ll
M llvm/test/CodeGen/AMDGPU/function-args-inreg.ll
M llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.convergencetokens.ll
M llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.error.ll
M llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.ll
Log Message:
-----------
[AMDGPU] Fix caller/callee mismatch in SGPR assignment for inreg args
On the callee side, `LowerFormalArguments` marks SGPR0-3 as allocated in
`CCState` before running the CC analysis. On the caller side, `LowerCall` (and
GlobalISel's `lowerCall`/`lowerTailCall`) added the scratch resource to
`RegsToPass` without marking it in `CCState`. This caused `CC_AMDGPU_Func` to
treat SGPR0-3 as available on the caller side, assigning user inreg args there,
while the callee skipped them without marking it in `CCState`. This caused
`CC_AMDGPU_Func` to treat SGPR0-3 as available on the caller side, assigning
user inreg args there, while the callee skipped them.
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