11; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-vulkan-unknown %s -o - | FileCheck %s
22; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %}
33
4- ; This file generated from the following command:
5- ; clang -cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -finclude-default-header - -o - <<EOF
6- ; [shader("compute")]
7- ; [numthreads(1,1,1)]
8- ; void main(uint3 ID : SV_GroupID) {}
9- ; EOF
10-
114; CHECK-DAG: %[[#int:]] = OpTypeInt 32 0
125; CHECK-DAG: %[[#v3int:]] = OpTypeVector %[[#int]] 3
136; CHECK-DAG: %[[#ptr_Input_v3int:]] = OpTypePointer Input %[[#v3int]]
1912; CHECK-DAG: OpDecorate %[[#WorkgroupId]] LinkageAttributes "__spirv_BuiltInWorkgroupId" Import
2013; CHECK-DAG: OpDecorate %[[#WorkgroupId]] BuiltIn WorkgroupId
2114
22- ; ModuleID = '-'
23- source_filename = "-"
24- target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
2515target triple = "spirv-unknown-vulkan-library"
2616
27- ; Function Attrs: alwaysinline convergent mustprogress norecurse nounwind
28- define internal spir_func void @_Z4mainDv3_j (<3 x i32 > noundef %ID ) #0 {
29- entry:
30- %0 = call token @llvm.experimental.convergence.entry ()
31- %ID.addr = alloca <3 x i32 >, align 16
32- store <3 x i32 > %ID , ptr %ID.addr , align 16
33- ret void
34- }
17+ declare void @group_id_user (<3 x i32 >)
3518
3619; Function Attrs: convergent noinline norecurse
3720define void @main () #1 {
3821entry:
39- %0 = call token @llvm.experimental.convergence.entry ()
4022
4123; CHECK: %[[#load:]] = OpLoad %[[#v3int]] %[[#WorkgroupId]]
4224; CHECK: %[[#load0:]] = OpCompositeExtract %[[#int]] %[[#load]] 0
@@ -59,24 +41,12 @@ entry:
5941; CHECK: %[[#tempvar:]] = OpCompositeInsert %[[#v3int]] %[[#load2]] %[[#tempvar]] 2
6042 %6 = insertelement <3 x i32 > %4 , i32 %5 , i64 2
6143
62- call spir_func void @_Z4mainDv3_j (<3 x i32 > %6 ) [ "convergencectrl" (token %0 ) ]
44+ call spir_func void @group_id_user (<3 x i32 > %6 )
6345 ret void
6446}
6547
66- ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
67- declare token @llvm.experimental.convergence.entry () #2
68-
6948; Function Attrs: nounwind willreturn memory(none)
7049declare i32 @llvm.spv.group.id (i32 ) #3
7150
72- attributes #0 = { alwaysinline convergent mustprogress norecurse nounwind "no-trapping-math" ="true" "stack-protector-buffer-size" ="8" }
7351attributes #1 = { convergent noinline norecurse "hlsl.numthreads" ="1,1,1" "hlsl.shader" ="compute" "no-trapping-math" ="true" "stack-protector-buffer-size" ="8" }
74- attributes #2 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
7552attributes #3 = { nounwind willreturn memory(none) }
76-
77- !llvm.module.flags = !{!0 , !1 }
78- !llvm.ident = !{!2 }
79-
80- !0 = !{i32 1 , !"wchar_size" , i32 4 }
81- !1 = !{i32 4 , !"dx.disable_optimizations" , i32 1 }
82- !2 = !{!"clang version 20.0.0git (https://github.com/llvm/llvm-project.git 4075ddad7183e6f0b66e2c8cc7a03b461a8038e6)" }
0 commit comments