brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 46a7cf4 Raw
52 lines · plain
1; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s2 3; CHECK-DAG: OpEntryPoint Kernel %[[#test_func:]] "test"4; CHECK-DAG: OpDecorate %[[#f2_decl:]] LinkageAttributes "BuiltInGlobalOffset" Import5; CHECK-DAG: %[[#int32_ty:]] = OpTypeInt 32 06; CHECK-DAG: %[[#i32ptr_ty:]] = OpTypePointer CrossWorkgroup  %[[#int32_ty]]7; CHECK-DAG: %[[#void_ty:]] = OpTypeVoid8; CHECK-DAG: %[[#func_ty:]] = OpTypeFunction %[[#void_ty]] %[[#i32ptr_ty]]9; CHECK-DAG: %[[#int64_ty:]] = OpTypeInt 64 010; CHECK-DAG: %[[#vec_ty:]] = OpTypeVector %[[#int64_ty]] 311; CHECK-DAG: %[[#func2_ty:]] = OpTypeFunction %[[#vec_ty]]12;; TODO: add 64-bit constant defs13; CHECK-DAG: %[[#f2_decl]] = OpFunction %[[#vec_ty]] Pure %[[#func2_ty]]14; CHECK: OpFunctionEnd15;; Check that the function register name does not match other registers16; CHECK-NOT: %[[#void_ty]] = OpFunction17; CHECK-NOT: %[[#func_ty]] = OpFunction18; CHECK-NOT: %[[#int64_ty]] = OpFunction19; CHECK-NOT: %[[#vec_ty]] = OpFunction20; CHECK-NOT: %[[#func2_ty]] = OpFunction21; CHECK-NOT: %[[#f2_decl]] = OpFunction22 23define spir_kernel void @test(i32 addrspace(1)* %outOffsets) {24entry:25  %0 = call spir_func <3 x i64> @BuiltInGlobalOffset() #126  %call = extractelement <3 x i64> %0, i32 027  %conv = trunc i64 %call to i3228; CHECK: %[[#i1:]] = OpInBoundsPtrAccessChain %[[#i32ptr_ty]] %[[#outOffsets:]]29; CHECK: OpStore %[[#i1:]] %[[#]] Aligned 430  %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %outOffsets, i64 031  store i32 %conv, i32 addrspace(1)* %arrayidx, align 432  %1 = call spir_func <3 x i64> @BuiltInGlobalOffset() #133  %call1 = extractelement <3 x i64> %1, i32 134  %conv2 = trunc i64 %call1 to i3235; CHECK: %[[#i2:]] = OpInBoundsPtrAccessChain %[[#i32ptr_ty]] %[[#outOffsets]]36; CHECK: OpStore %[[#i2:]] %[[#]] Aligned 437  %arrayidx3 = getelementptr inbounds i32, i32 addrspace(1)* %outOffsets, i64 138  store i32 %conv2, i32 addrspace(1)* %arrayidx3, align 439  %2 = call spir_func <3 x i64> @BuiltInGlobalOffset() #140  %call4 = extractelement <3 x i64> %2, i32 241  %conv5 = trunc i64 %call4 to i3242; CHECK: %[[#i3:]] = OpInBoundsPtrAccessChain %[[#i32ptr_ty]] %[[#outOffsets]]43; CHECK: OpStore %[[#i3:]] %[[#]] Aligned 444  %arrayidx6 = getelementptr inbounds i32, i32 addrspace(1)* %outOffsets, i64 245  store i32 %conv5, i32 addrspace(1)* %arrayidx6, align 446  ret void47}48 49declare spir_func <3 x i64> @BuiltInGlobalOffset() #150 51attributes #1 = { nounwind readnone }52