Handle a special case when StoreInst's value operand is a kernel argument of a pointer type. Since these arguments could have either a basic element type (e.g. float*) or OpenCL builtin type (sampler_t), bitcast the StoreInst's value operand to default pointer element type (i8). This pull request addresses the issue https://github.com/llvm/llvm-project/issues/72864
15 lines
548 B
LLVM
15 lines
548 B
LLVM
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
|
|
|
|
; CHECK-DAG: %[[#CHAR:]] = OpTypeInt 8
|
|
; CHECK-DAG: %[[#GLOBAL_PTR_CHAR:]] = OpTypePointer CrossWorkgroup %[[#CHAR]]
|
|
|
|
define spir_kernel void @foo(i8 %a, ptr addrspace(1) %p) {
|
|
store i8 %a, ptr addrspace(1) %p
|
|
ret void
|
|
}
|
|
|
|
; CHECK: %[[#A:]] = OpFunctionParameter %[[#CHAR]]
|
|
; CHECK: %[[#P:]] = OpFunctionParameter %[[#GLOBAL_PTR_CHAR]]
|
|
; CHECK: OpStore %[[#P]] %[[#A]]
|