Skip to content
Snippets Groups Projects
  • Pekka Jaaskelainen's avatar
    140f5e80
    [OpenCL] Makes kernels use the SPIR_KERNEL CC by default. · 140f5e80
    Pekka Jaaskelainen authored
    Rationale: OpenCL kernels are called via an explicit runtime API
    with arguments set with clSetKernelArg(), not as normal sub-functions.
    Return SPIR_KERNEL by default as the kernel calling convention to ensure
    the fingerprint is fixed such way that each OpenCL argument gets one
    matching argument in the produced kernel function argument list to enable
    feasible implementation of clSetKernelArg() with aggregates etc. In case
    we would use the default C calling conv here, clSetKernelArg() might
    break depending on the target-specific conventions; different targets
    might split structs passed as values to multiple function arguments etc.
    
    https://reviews.llvm.org/D33639
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304389 91177308-0d34-0410-b5e6-96231b3b80d8
    140f5e80
    History
    [OpenCL] Makes kernels use the SPIR_KERNEL CC by default.
    Pekka Jaaskelainen authored
    Rationale: OpenCL kernels are called via an explicit runtime API
    with arguments set with clSetKernelArg(), not as normal sub-functions.
    Return SPIR_KERNEL by default as the kernel calling convention to ensure
    the fingerprint is fixed such way that each OpenCL argument gets one
    matching argument in the produced kernel function argument list to enable
    feasible implementation of clSetKernelArg() with aggregates etc. In case
    we would use the default C calling conv here, clSetKernelArg() might
    break depending on the target-specific conventions; different targets
    might split structs passed as values to multiple function arguments etc.
    
    https://reviews.llvm.org/D33639
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304389 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.