Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveIsFirstLane.ll

raw
1 ; RUN: llc -O0 -mtriple=spirv-unknown-linux %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %}
3
4 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
5 target triple = "spirv-unknown-vulkan-compute"
6
7 ; CHECK-DAG: %[[#uint:]] = OpTypeInt 32 0
8 ; CHECK-DAG: %[[#uint_3:]] = OpConstant %[[#uint]] 3
9 ; CHECK-DAG: %[[#bool:]] = OpTypeBool
10
11 define spir_func void @main() #0 {
12 entry:
13 %0 = call token @llvm.experimental.convergence.entry()
14 ; CHECK: %[[#]] = OpGroupNonUniformElect %[[#bool]] %[[#uint_3]]
15 %1 = call i1 @llvm.spv.wave.is.first.lane() [ "convergencectrl"(token %0) ]
16 ret void
17 }
18
19 declare i32 @__hlsl_wave_get_lane_index() #1
20
21 attributes #0 = { convergent norecurse "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
22 attributes #1 = { convergent }
23
24 !llvm.module.flags = !{!0, !1}
25
26 !0 = !{i32 1, !"wchar_size", i32 4}
27 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}