Debian Codegraph @

llvm/test/CodeGen/SPIRV/pointers/bitcast-fix-store.ll

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
4 ; CHECK-DAG: %[[#TYLONG:]] = OpTypeInt 32 0
5 ; CHECK-DAG: %[[#TYLONGPTR:]] = OpTypePointer Function %[[#TYLONG]]
6 ; CHECK-DAG: %[[#TYSTRUCT:]] = OpTypeStruct %[[#TYLONG]]
7 ; CHECK-DAG: %[[#CONST:]] = OpConstant %[[#TYLONG]] 3
8 ; CHECK-DAG: %[[#TYSTRUCTPTR:]] = OpTypePointer Function %[[#TYSTRUCT]]
9 ; CHECK: OpFunction
10 ; CHECK: %[[#ARGPTR1:]] = OpFunctionParameter %[[#TYLONGPTR]]
11 ; CHECK: OpStore %[[#ARGPTR1]] %[[#CONST:]]
12 ; CHECK: OpFunction
13 ; CHECK: %[[#OBJ:]] = OpFunctionParameter %[[#TYSTRUCT]]
14 ; CHECK: %[[#ARGPTR2:]] = OpFunctionParameter %[[#TYLONGPTR]]
15 ; CHECK: %[[#PTRTOSTRUCT:]] = OpBitcast %[[#TYSTRUCTPTR]] %[[#ARGPTR2]]
16 ; CHECK-NEXT: OpStore %[[#PTRTOSTRUCT]] %[[#OBJ]]
17
18 %struct.S = type { i32 }
19 %struct.__wrapper_class = type { [7 x %struct.S] }
20
21 define spir_kernel void @foo(%struct.S %arg, ptr %ptr) {
22 entry:
23 store %struct.S %arg, ptr %ptr
24 ret void
25 }
26
27 define spir_kernel void @bar(ptr %ptr) {
28 entry:
29 store i32 3, ptr %ptr
30 ret void
31 }