Debian Codegraph @

llvm/test/CodeGen/SPIRV/pointers/composite-fun-fix-ptr-arg.ll

raw
1 ; The goal of the test case is to ensure that if module contains functions with mutated signature
2 ; (due to preprocessing of aggregate types), functions still are going through re-creating of
3 ; function type to preserve pointee type information for arguments.
4
5 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
6 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
7
8 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
9 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
10
11 ; CHECK-DAG: %[[#Int8:]] = OpTypeInt 8 0
12 ; CHECK-DAG: %[[#Half:]] = OpTypeFloat 16
13 ; CHECK-DAG: %[[#Float:]] = OpTypeFloat 32
14 ; CHECK-DAG: %[[#Struct:]] = OpTypeStruct %[[#Half]]
15 ; CHECK-DAG: %[[#Void:]] = OpTypeVoid
16 ; CHECK-DAG: %[[#PtrInt8:]] = OpTypePointer CrossWorkgroup %[[#Int8:]]
17 ; CHECK-DAG: %[[#FooType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt8]] %[[#Struct]]
18 ; CHECK-DAG: %[[#Int64:]] = OpTypeInt 64 0
19 ; CHECK-DAG: %[[#PtrInt64:]] = OpTypePointer CrossWorkgroup %[[#Int64]]
20 ; CHECK-DAG: %[[#BarType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt64]] %[[#Struct]]
21 ; CHECK-DAG: %[[#BazType:]] = OpTypeFunction %[[#Void]] %[[#PtrInt8]] %[[#Struct]] %[[#Int8]] %[[#Struct]] %[[#Float]] %[[#Struct]]
22 ; CHECK: OpFunction %[[#Void]] None %[[#FooType]]
23 ; CHECK: OpFunctionParameter %[[#PtrInt8]]
24 ; CHECK: OpFunctionParameter %[[#Struct]]
25 ; CHECK: OpFunction %[[#Void]] None %[[#BarType]]
26 ; CHECK: OpFunctionParameter %[[#PtrInt64]]
27 ; CHECK: OpFunctionParameter %[[#Struct]]
28 ; CHECK: OpFunction %[[#Void]] None %[[#BazType]]
29 ; CHECK: OpFunctionParameter %[[#PtrInt8]]
30 ; CHECK: OpFunctionParameter %[[#Struct]]
31 ; CHECK: OpFunctionParameter %[[#Int8]]
32 ; CHECK: OpFunctionParameter %[[#Struct]]
33 ; CHECK: OpFunctionParameter %[[#Float]]
34 ; CHECK: OpFunctionParameter %[[#Struct]]
35
36 %t_half = type { half }
37
38 define spir_kernel void @foo(ptr addrspace(1) %a, %t_half %b) {
39 entry:
40 ret void
41 }
42
43
44 define spir_kernel void @bar(ptr addrspace(1) %a, %t_half %b) {
45 entry:
46 %r = getelementptr inbounds i64, ptr addrspace(1) %a, i64 0
47 ret void
48 }
49
50 define spir_kernel void @baz(ptr addrspace(1) %a, %t_half %b, i8 %c, %t_half %d, float %e, %t_half %f) {
51 entry:
52 ret void
53 }
54
55 declare spir_func %t_half @_Z29__spirv_SpecConstantComposite(half)