[PATCH] D92721: [PATCH] [clang] Create SPIRABIInfo to enable SPIR_FUNC calling convention

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 10 13:32:00 PST 2020


mibintc added a comment.

Answering my own questions

In D92721#2441068 <https://reviews.llvm.org/D92721#2441068>, @mibintc wrote:

> Thanks @Anastasia ; I modified CGBuiltin.cpp to use EmitRuntimeCall when creating calls to runtime functions instead of Builder.CreateCall so this is setting the CallingConvention on the Call node using the ABIInfo.  I changed a few lit tests that were failing because of this.
>
> I have a question, the clang test CodeGenOpenCL/cl20-device-side-enqueue.cl has this function, device_side_enqueue_block_invoke_9 which is defined with spir_func CC. The call doesn't have that CC. Where is that call created?  Seems like the call should have spir_func CC, I want to fix that.

I found the place where the call was created and updated the CC

> Likewise device_side_enqueue_block_invoke_9_kernel has spir_kernel CC.  How does the CC get set to spir_kernel, I don't see where that is happening

The function is declared with "OpenCL Kernel" calling convention, but target-specific ClangCallConvToLLVMCallConv converts that to SPIR_KERNEL that's why I couldn't find it when doing a text search in clang

> define internal spir_func void @__device_side_enqueue_block_invoke_9(i8 addrspace(4)* %.block_descriptor, i8 addrspace(3)* %p1, i8 addrspace(3)* %p2, i8 addrspace(3)* %p3) #1 {
> define internal spir_kernel void @__device_side_enqueue_block_invoke_9_kernel(i8 addrspace(4)* %0, i8 addrspace(3)* %1, i8 addrspace(3)* %2, i8 addrspace(3)* %3) #5 {
>
>   call void @__device_side_enqueue_block_invoke_9(i8 addrspace(4)* %0, i8 addrspace(3)* %1, i8 addrspace(3)* %2, i8 addrspace(3)* %3)




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92721/new/

https://reviews.llvm.org/D92721



More information about the cfe-commits mailing list