1 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
2 // RUN: spirv-pc-vulkan-library %s -emit-llvm -disable-llvm-passes -o - | FileCheck %s
4 // CHECK: define spir_func void @{{.*main.*}}() [[A0:#[0-9]+]] {
7 // CHECK: %[[CT_ENTRY:[0-9]+]] = call token @llvm.experimental.convergence.entry()
8 // CHECK: br label %[[LABEL_WHILE_COND:.+]]
11 // CHECK: [[LABEL_WHILE_COND]]:
12 // CHECK: %[[CT_LOOP:[0-9]+]] = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %[[CT_ENTRY]]) ]
13 // CHECK: br label %[[LABEL_WHILE_BODY:.+]]
16 // CHECK: [[LABEL_WHILE_BODY]]:
17 // CHECK: br i1 {{%.+}}, label %[[LABEL_IF_THEN:.+]], label %[[LABEL_IF_END:.+]]
19 // CHECK: [[LABEL_IF_THEN]]:
20 // CHECK: call spir_func i32 @__hlsl_wave_get_lane_index() [ "convergencectrl"(token %[[CT_LOOP]]) ]
21 // CHECK: br label %[[LABEL_WHILE_END:.+]]
23 uint index = WaveGetLaneIndex();
27 // CHECK: [[LABEL_IF_END]]:
28 // CHECK: br label %[[LABEL_WHILE_COND]]
32 // CHECK: [[LABEL_WHILE_END]]:
36 // CHECK-DAG: declare spir_func i32 @__hlsl_wave_get_lane_index() [[A1:#[0-9]+]]
38 // CHECK-DAG: attributes [[A0]] = {{{.*}}convergent{{.*}}}
39 // CHECK-DAG: attributes [[A1]] = {{{.*}}convergent{{.*}}}