1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
3 ; CHECK: OpName %[[#WD:]] "__spirv_BuiltInWorkDim"
4 ; CHECK: OpName %[[#GS:]] "__spirv_BuiltInGlobalSize"
5 ; CHECK: OpName %[[#GII:]] "__spirv_BuiltInGlobalInvocationId"
6 ; CHECK: OpName %[[#WS:]] "__spirv_BuiltInWorkgroupSize"
7 ; CHECK: OpName %[[#EWS:]] "__spirv_BuiltInEnqueuedWorkgroupSize"
8 ; CHECK: OpName %[[#LLI:]] "__spirv_BuiltInLocalInvocationId"
9 ; CHECK: OpName %[[#NW:]] "__spirv_BuiltInNumWorkgroups"
10 ; CHECK: OpName %[[#WI:]] "__spirv_BuiltInWorkgroupId"
11 ; CHECK: OpName %[[#GO:]] "__spirv_BuiltInGlobalOffset"
12 ; CHECK: OpName %[[#GLI:]] "__spirv_BuiltInGlobalLinearId"
13 ; CHECK: OpName %[[#LLII:]] "__spirv_BuiltInLocalInvocationIndex"
14 ; CHECK: OpName %[[#SS:]] "__spirv_BuiltInSubgroupSize"
15 ; CHECK: OpName %[[#SMS:]] "__spirv_BuiltInSubgroupMaxSize"
16 ; CHECK: OpName %[[#NS:]] "__spirv_BuiltInNumSubgroups"
17 ; CHECK: OpName %[[#NES:]] "__spirv_BuiltInNumEnqueuedSubgroups"
18 ; CHECK: OpName %[[#SI:]] "__spirv_BuiltInSubgroupId"
19 ; CHECK: OpName %[[#SLII:]] "__spirv_BuiltInSubgroupLocalInvocationId"
21 ; CHECK-DAG: OpDecorate %[[#NW]] BuiltIn NumWorkgroups
22 ; CHECK-DAG: OpDecorate %[[#WS]] BuiltIn WorkgroupSize
23 ; CHECK-DAG: OpDecorate %[[#WI]] BuiltIn WorkgroupId
24 ; CHECK-DAG: OpDecorate %[[#LLI]] BuiltIn LocalInvocationId
25 ; CHECK-DAG: OpDecorate %[[#GII]] BuiltIn GlobalInvocationId
26 ; CHECK-DAG: OpDecorate %[[#LLII]] BuiltIn LocalInvocationIndex
27 ; CHECK-DAG: OpDecorate %[[#WD]] BuiltIn WorkDim
28 ; CHECK-DAG: OpDecorate %[[#GS]] BuiltIn GlobalSize
29 ; CHECK-DAG: OpDecorate %[[#EWS]] BuiltIn EnqueuedWorkgroupSize
30 ; CHECK-DAG: OpDecorate %[[#GO]] BuiltIn GlobalOffset
31 ; CHECK-DAG: OpDecorate %[[#GLI]] BuiltIn GlobalLinearId
32 ; CHECK-DAG: OpDecorate %[[#SS]] BuiltIn SubgroupSize
33 ; CHECK-DAG: OpDecorate %[[#SMS]] BuiltIn SubgroupMaxSize
34 ; CHECK-DAG: OpDecorate %[[#NS]] BuiltIn NumSubgroups
35 ; CHECK-DAG: OpDecorate %[[#NES]] BuiltIn NumEnqueuedSubgroups
36 ; CHECK-DAG: OpDecorate %[[#SI]] BuiltIn SubgroupId
37 ; CHECK-DAG: OpDecorate %[[#SLII]] BuiltIn SubgroupLocalInvocationId
38 @__spirv_BuiltInWorkDim = external addrspace(1) global i32
39 @__spirv_BuiltInGlobalSize = external addrspace(1) global <3 x i32>
40 @__spirv_BuiltInGlobalInvocationId = external addrspace(1) global <3 x i32>
41 @__spirv_BuiltInWorkgroupSize = external addrspace(1) global <3 x i32>
42 @__spirv_BuiltInEnqueuedWorkgroupSize = external addrspace(1) global <3 x i32>
43 @__spirv_BuiltInLocalInvocationId = external addrspace(1) global <3 x i32>
44 @__spirv_BuiltInNumWorkgroups = external addrspace(1) global <3 x i32>
45 @__spirv_BuiltInWorkgroupId = external addrspace(1) global <3 x i32>
46 @__spirv_BuiltInGlobalOffset = external addrspace(1) global <3 x i32>
47 @__spirv_BuiltInGlobalLinearId = external addrspace(1) global i32
48 @__spirv_BuiltInLocalInvocationIndex = external addrspace(1) global i32
49 @__spirv_BuiltInSubgroupSize = external addrspace(1) global i32
50 @__spirv_BuiltInSubgroupMaxSize = external addrspace(1) global i32
51 @__spirv_BuiltInNumSubgroups = external addrspace(1) global i32
52 @__spirv_BuiltInNumEnqueuedSubgroups = external addrspace(1) global i32
53 @__spirv_BuiltInSubgroupId = external addrspace(1) global i32
54 @__spirv_BuiltInSubgroupLocalInvocationId = external addrspace(1) global i32
56 define spir_kernel void @_Z1wv() {