llvm-project
239e14ba - [NFC][AMDGPU] Add test showing caller/callee SGPR mismatch for inreg args (#182753)

Commit
60 days ago
[NFC][AMDGPU] Add test showing caller/callee SGPR mismatch for inreg args (#182753) 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.
Author
Parents
Loading