Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/builtin_vars.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
4 ; RUN: spirv-val %t.spv
5 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.out.bc
6 ; RUN: llvm-dis %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-OCL-IR
7 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv --spirv-target-env=SPV-IR -o %t.out.bc
8 ; RUN: llvm-dis %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-SPV-IR
9
10 ; Check that produced builtin-call-based SPV-IR is recognized by the translator
11 ; RUN: llvm-spirv -spirv-text %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-SPIRV
12
13 ; CHECK-SPIRV: Decorate [[Id:[0-9]+]] BuiltIn 34
14 ; CHECK-SPIRV: Variable {{[0-9]+}} [[Id:[0-9]+]]
15
16 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
17 target triple = "spir-unknown-unknown"
18
19 @__spirv_BuiltInGlobalLinearId = external addrspace(1) global i32
20
21 ; Function Attrs: nounwind readnone
22 define spir_kernel void @f() #0 !kernel_arg_addr_space !0 !kernel_arg_access_qual !0 !kernel_arg_type !0 !kernel_arg_base_type !0 !kernel_arg_type_qual !0 {
23 entry:
24 %0 = load i32, i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @__spirv_BuiltInGlobalLinearId to i32 addrspace(4)*), align 4
25 ; CHECK-OCL-IR: %0 = call spir_func i32 @_Z20get_global_linear_idv() #1
26 ; CHECK-SPV-IR: %0 = call spir_func i32 @_Z29__spirv_BuiltInGlobalLinearIdv() #1
27 ret void
28 }
29
30 attributes #0 = { alwaysinline nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
31
32 !0 = !{}