Issue 234232
Summary [AMDGPU] Entry function passes an inreg call argument in s0 instead of s16
Labels new issue
Assignees akadutta
Reporter akadutta
    On targets without flat scratch (`gfx900`, `gfx90a`, `gfx10`), a non-entry callee keeps its scratch descriptors in `s[0:3]` and reads its first `inreg` argument from `s16`. A call from an ordinary function matches that. But, a call from an entry function (`amdgpu_kernel` or `amdgpu_ps`) puts the `inreg` in `s0`, while the callee reads it from `s16`, and the copy overwrites the scratch descriptor.

Test attached with the CHECK labels generated by the current compiler.

[entry-call-inreg.ll.txt](https://github.com/user-attachments/files/33774140/entry-call-inreg.ll.txt)

AI disclaimer: AI helped with the analysis and creation of this test.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to