Debian Codegraph @

llvm/test/CodeGen/SPIRV/structurizer/switch-fallthrough.ll

raw
1 ; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
2
3 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-G10"
4 target triple = "spirv1.6-unknown-vulkan1.3-compute"
5
6 define spir_func noundef i32 @_Z7processv() #0 {
7 entry:
8 %0 = tail call token @llvm.experimental.convergence.entry()
9 %2 = tail call i32 @llvm.spv.thread.id.i32(i32 0)
10 switch i32 %2, label %sw1 [
11 i32 0, label %sw0
12 i32 2, label %sw0
13 ]
14
15 sw0:
16 %5 = call spir_func i1 @llvm.spv.wave.any(i1 false) [ "convergencectrl"(token %0) ]
17 br label %exit
18
19 sw1:
20 %6 = call spir_func i1 @llvm.spv.wave.any(i1 false) [ "convergencectrl"(token %0) ]
21 br label %exit
22
23 exit:
24 %.sink = phi i1 [ %5, %sw0 ], [ %6, %sw1 ]
25 %conv.i = zext i1 %.sink to i32
26 ret i32 %conv.i
27 }
28
29 define internal spir_func void @main() #0 {
30 entry:
31 %0 = call token @llvm.experimental.convergence.entry()
32 %call1 = call spir_func noundef i32 @_Z7processv() #0 [ "convergencectrl"(token %0) ]
33 ret void
34 }
35
36 declare i1 @llvm.spv.wave.any(i1) #0
37 declare i32 @llvm.spv.thread.id.i32(i32) #2
38 declare token @llvm.experimental.convergence.entry() #0
39
40 attributes #0 = { convergent mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
41 attributes #1 = { convergent mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) "frame-pointer"="all" "hlsl.numthreads"="4,1,1" "hlsl.shader"="compute" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
42 attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) }