brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · eccd36d Raw
52 lines · plain
1; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}2; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s3 4target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"5target triple = "spirv-unknown-vulkan-compute"6 7define internal spir_func void @main() #0 {8 9; CHECK:   %[[#entry:]] = OpLabel10; CHECK:                  OpBranch %[[#while_cond:]]11entry:12  %0 = call token @llvm.experimental.convergence.entry()13  %idx = alloca i32, align 414  store i32 -1, ptr %idx, align 415  br label %while.cond16 17; CHECK:   %[[#while_cond]] = OpLabel18; CHECK:                      OpBranchConditional %[[#cond:]] %[[#while_body:]] %[[#while_end:]]19while.cond:20  %1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]21  %2 = load i32, ptr %idx, align 422  %cmp = icmp ne i32 %2, 023  br i1 %cmp, label %while.body, label %while.end24 25; CHECK:        %[[#while_end]] = OpLabel26; CHECK-NEXT:                     OpReturn27while.end:28  ret void29 30; CHECK:   %[[#while_body]] = OpLabel31; CHECK:                      OpBranch %[[#while_cond]]32while.body:33  %3 = call i32 @__hlsl_wave_get_lane_index() [ "convergencectrl"(token %1) ]34  store i32 %3, ptr %idx, align 435  br label %while.cond36 37}38 39declare token @llvm.experimental.convergence.entry() #240declare token @llvm.experimental.convergence.loop() #241declare i32 @__hlsl_wave_get_lane_index() #342 43attributes #0 = { convergent noinline norecurse nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }44attributes #1 = { convergent norecurse "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }45attributes #2 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }46attributes #3 = { convergent }47 48!llvm.module.flags = !{!0, !1}49 50!0 = !{i32 1, !"wchar_size", i32 4}51!1 = !{i32 4, !"dx.disable_optimizations", i32 1}52