43 lines · plain
1; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}2 3target 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"4target triple = "spirv1.6-unknown-vulkan1.3-compute"5 6define spir_func noundef i32 @_Z7processv() #0 {7entry: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 %sw012 i32 2, label %sw013 ]14 15sw0:16 %5 = call spir_func i1 @llvm.spv.wave.any(i1 false) [ "convergencectrl"(token %0) ]17 br label %exit18 19sw1:20 %6 = call spir_func i1 @llvm.spv.wave.any(i1 false) [ "convergencectrl"(token %0) ]21 br label %exit22 23exit:24 %.sink = phi i1 [ %5, %sw0 ], [ %6, %sw1 ]25 %conv.i = zext i1 %.sink to i3226 ret i32 %conv.i27}28 29define internal spir_func void @main() #0 {30entry:31 %0 = call token @llvm.experimental.convergence.entry()32 %call1 = call spir_func noundef i32 @_Z7processv() #0 [ "convergencectrl"(token %0) ]33 ret void34}35 36declare i1 @llvm.spv.wave.any(i1) #037declare i32 @llvm.spv.thread.id.i32(i32) #238declare token @llvm.experimental.convergence.entry() #039 40attributes #0 = { convergent mustprogress nocallback nofree nosync nounwind willreturn memory(none) }41attributes #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" }42attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) }43