Add the amdgpu_cs_chain and amdgpu_cs_chain_preserve keywords to
LLVM IR and make sure we can parse and print them. Also make sure we
perform some basic checks in the IR verifier - similar to what we check
for many of the other AMDGPU calling conventions, plus the additional
restriction that we can't have direct calls to functions with these
calling conventions.
Details
- Reviewers
nhaehnle ruiling - Group Reviewers
Restricted Project - Commits
- rG29dcc4c143a7: [AMDGPU] Add amdgpu_cs_chain[_preserve] CCs to IR & verifier
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please upload the patch with full context.
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
3292 | Should check Call.getCallingConv(), instead of relying on whether or not we found a Callee function. |
llvm/test/Verifier/amdgpu-cc.ll | ||
---|---|---|
217 | Is a regular pointer to the stack allowed? |
llvm/test/Verifier/amdgpu-cc.ll | ||
---|---|---|
217 | You mean a ptr addrspace(5)? Yes, it's allowed, and we plan to use it. It's technically not going to be a *stack* pointer as far as LLVM is concerned, because the stack is "dormant"/"inexistent" between chain functions. The plan is to split the wave's scratch allocation into two parts, the bottom part under the control of LLVM and the top part under the control of the frontend, and so passing pointers to that top part can still be meaningful even though the stack "doesn't exist" at chain function boundaries as far as LLVM is concerned. In principle, we also allow pointers to other address spaces, although I don't see us using those at least for the time being. |
llvm/include/llvm/IR/CallingConv.h | ||
---|---|---|
244–245 | Should say how the _Preserve variant differs |
llvm/test/Verifier/amdgpu-cc.ll | ||
---|---|---|
233 | Check a call to a function pointer |
Should say how the _Preserve variant differs