brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 447dfa7 Raw
65 lines · plain
1; RUN: llc -O2 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O2 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}3 4; RUN: llc -O2 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s5; RUN: %if spirv-tools %{ llc -O2 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}6 7; CHECK-DAG: %[[#Char:]] = OpTypeInt 8 08; CHECK-DAG: %[[#PtrChar:]] = OpTypePointer CrossWorkgroup %[[#Char]]9; CHECK-DAG: %[[#Int:]] = OpTypeInt 32 010; CHECK-DAG: %[[#PtrInt:]] = OpTypePointer CrossWorkgroup %[[#Int]]11; CHECK-DAG: %[[#C648:]] = OpConstant %[[#]] 64812; CHECK-DAG: %[[#Struct:]] = OpTypeStruct %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]] %[[#]]13; CHECK-DAG: %[[#VarInit:]] = OpConstantNull %[[#Struct]]14; CHECK-DAG: %[[#PtrStruct:]] = OpTypePointer CrossWorkgroup %[[#Struct]]15; CHECK-DAG: %[[#Var:]] = OpVariable %[[#PtrStruct]] CrossWorkgroup %[[#VarInit]]16; CHECK-DAG: %[[#Bytes:]] = OpVariable %[[#PtrChar]] CrossWorkgroup %[[#]]17; CHECK-DAG: %[[#BytesGEP:]] = OpSpecConstantOp %[[#PtrChar]] InBoundsPtrAccessChain %[[#Bytes]] %[[#C648]]18 19; CHECK: OpFunction20; CHECK: %[[#]] = OpFunctionParameter %[[#]]21; CHECK: %[[#Line:]] = OpFunctionParameter %[[#Int]]22; CHECK: %[[#]] = OpFunctionParameter %[[#]]23; CHECK: %[[#Casted:]] = OpBitcast %[[#PtrChar]] %[[#Var]]24; CHECK: %[[#AddrChar:]] = OpInBoundsPtrAccessChain %[[#PtrChar]] %[[#Casted]] %[[#C648]]25; CHECK: %[[#AddrInt:]] = OpBitcast %[[#PtrInt]] %[[#AddrChar]]26; CHECK: OpStore %[[#AddrInt]] %[[#Line]]27 28%struct = type { i32, [257 x i8], [257 x i8], [129 x i8], i32, i64, i64, i64, i64, i64, i64 }29@Mem = linkonce_odr dso_local addrspace(1) global %struct zeroinitializer, align 830 31define weak dso_local spir_func void @foo(ptr addrspace(4) noundef %expr, i32 noundef %line, i1 %fl) {32entry:33  %cmp = icmp eq i32 %line, 034  br i1 %cmp, label %lbl, label %exit35 36lbl:37  store i32 %line, ptr addrspace(1) getelementptr inbounds (i8, ptr addrspace(1) @Mem, i64 648), align 838  br i1 %fl, label %lbl, label %exit39 40exit:41  ret void42}43 44; CHECK: OpFunction45; CHECK: %[[#]] = OpFunctionParameter %[[#]]46; CHECK: %[[#Line2:]] = OpFunctionParameter %[[#Int]]47; CHECK: %[[#]] = OpFunctionParameter %[[#]]48; CHECK: %[[#AddrInt2:]] = OpBitcast %[[#PtrInt]] %[[#BytesGEP]]49; CHECK: OpStore %[[#AddrInt2]] %[[#Line2]]50 51@Bytes = linkonce_odr dso_local addrspace(1) global i8 zeroinitializer, align 852 53define weak dso_local spir_func void @bar(ptr addrspace(4) noundef %expr, i32 noundef %line, i1 %fl) {54entry:55  %cmp = icmp eq i32 %line, 056  br i1 %cmp, label %lbl, label %exit57 58lbl:59  store i32 %line, ptr addrspace(1) getelementptr inbounds (i8, ptr addrspace(1) @Bytes, i64 648), align 860  br i1 %fl, label %lbl, label %exit61 62exit:63  ret void64}65