Skip to content

Commit b2dbe55

Browse files
committed
[IR] Mark convergence intrins as has-side-effect
When a callee is marked as `convergent`, some targets like HLSL/SPIR-V add a convergent token to the call. This is valid if both functions are marked as `convergent`. ADCE/BDCE and other DCE passes were allowed to remove convergence intrinsics when their token were unused. This meant a leaf function could lose all its convergence intrinsics. This would allow further optimization to remove the `convergent` attribute from the callee. Issue was the caller was not updated, and we now had a convergence token attached to a call function calling a non-convergent function. This can be solved in different ways: - modify DCE passes to keep calls marked as convergent. - add a 'hasSideEffect' to the intrinsics definition, preventing DCE to remove the intrinsic. - fix optimization passed removing the attribute by also removing the tokens from the call. I picked the second option: mark those as `hasSideEffects`, because convergence intrinsics presence impact the divergence/reconvergence location of the IR, hence their simple presence has an implicit meaning. This is particularly important for SPIR-V as the control flow shape will depend on the presence of those intrinsics. An alternative I could agree to modifying each pass to keep the convergence intrinsics. After all, they are important, but the widening the 'hadSideEffect' meaning could be discussed. I however would be against the 3rd solution: SPIR-V benefits greatly from the convergence intrinsics presence to correctly structurize loops.
1 parent 7d4ea77 commit b2dbe55

File tree

16 files changed

+174
-9
lines changed

16 files changed

+174
-9
lines changed

clang/test/CodeGenHLSL/builtins/RWBuffer-constructor-opt.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -O3 -o - %s | FileCheck %s
2-
// RUN: %clang_cc1 -triple spirv-vulkan-compute -x hlsl -emit-llvm -O3 -o - %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple spirv-vulkan-compute -x hlsl -emit-llvm -O3 -o - %s | FileCheck %s --check-prefixes=CHECK,SPIRV
33

44
// All referenced to an unused resource should be removed by optimizations.
55
RWBuffer<float> Buf : register(u5, space3);
@@ -10,6 +10,7 @@ void main() {
1010
// CHECK-NOT: resource.handlefrombinding
1111
// CHECK: define void @main()
1212
// CHECK-NEXT: entry:
13+
// SPIRV-NEXT: %0 = tail call token @llvm.experimental.convergence.entry()
1314
// CHECK-NEXT: ret void
1415
// CHECK-NOT: resource.handlefrombinding
1516
}

clang/test/CodeGenHLSL/builtins/distance.hlsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z18test_distance_halfDhDh(
1717
// SPVCHECK-SAME: half noundef nofpclass(nan inf) [[X:%.*]], half noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
1818
// SPVCHECK-NEXT: [[ENTRY:.*:]]
19+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
1920
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn half [[X]], [[Y]]
2021
// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.fabs.f16(half [[SUB_I]])
2122
// SPVCHECK-NEXT: ret half [[ELT_ABS_I]]
@@ -33,6 +34,7 @@ half test_distance_half(half X, half Y) { return distance(X, Y); }
3334
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z19test_distance_half2Dv2_DhS_(
3435
// SPVCHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[X:%.*]], <2 x half> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
3536
// SPVCHECK-NEXT: [[ENTRY:.*:]]
37+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
3638
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <2 x half> [[X]], [[Y]]
3739
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v2f16(<2 x half> [[SUB_I]])
3840
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
@@ -50,6 +52,7 @@ half test_distance_half2(half2 X, half2 Y) { return distance(X, Y); }
5052
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z19test_distance_half3Dv3_DhS_(
5153
// SPVCHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[X:%.*]], <3 x half> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
5254
// SPVCHECK-NEXT: [[ENTRY:.*:]]
55+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
5356
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <3 x half> [[X]], [[Y]]
5457
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v3f16(<3 x half> [[SUB_I]])
5558
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
@@ -67,6 +70,7 @@ half test_distance_half3(half3 X, half3 Y) { return distance(X, Y); }
6770
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z19test_distance_half4Dv4_DhS_(
6871
// SPVCHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[X:%.*]], <4 x half> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
6972
// SPVCHECK-NEXT: [[ENTRY:.*:]]
73+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
7074
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <4 x half> [[X]], [[Y]]
7175
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v4f16(<4 x half> [[SUB_I]])
7276
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
@@ -83,6 +87,7 @@ half test_distance_half4(half4 X, half4 Y) { return distance(X, Y); }
8387
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z19test_distance_floatff(
8488
// SPVCHECK-SAME: float noundef nofpclass(nan inf) [[X:%.*]], float noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
8589
// SPVCHECK-NEXT: [[ENTRY:.*:]]
90+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
8691
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn float [[X]], [[Y]]
8792
// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.fabs.f32(float [[SUB_I]])
8893
// SPVCHECK-NEXT: ret float [[ELT_ABS_I]]
@@ -100,6 +105,7 @@ float test_distance_float(float X, float Y) { return distance(X, Y); }
100105
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z20test_distance_float2Dv2_fS_(
101106
// SPVCHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[X:%.*]], <2 x float> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
102107
// SPVCHECK-NEXT: [[ENTRY:.*:]]
108+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
103109
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <2 x float> [[X]], [[Y]]
104110
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v2f32(<2 x float> [[SUB_I]])
105111
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]
@@ -117,6 +123,7 @@ float test_distance_float2(float2 X, float2 Y) { return distance(X, Y); }
117123
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z20test_distance_float3Dv3_fS_(
118124
// SPVCHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[X:%.*]], <3 x float> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
119125
// SPVCHECK-NEXT: [[ENTRY:.*:]]
126+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
120127
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <3 x float> [[X]], [[Y]]
121128
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v3f32(<3 x float> [[SUB_I]])
122129
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]
@@ -134,6 +141,7 @@ float test_distance_float3(float3 X, float3 Y) { return distance(X, Y); }
134141
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z20test_distance_float4Dv4_fS_(
135142
// SPVCHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[X:%.*]], <4 x float> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
136143
// SPVCHECK-NEXT: [[ENTRY:.*:]]
144+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
137145
// SPVCHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn <4 x float> [[X]], [[Y]]
138146
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v4f32(<4 x float> [[SUB_I]])
139147
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]

clang/test/CodeGenHLSL/builtins/length.hlsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z16test_length_halfDh(
2121
// SPVCHECK-SAME: half noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
2222
// SPVCHECK-NEXT: [[ENTRY:.*:]]
23+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
2324
// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.fabs.f16(half [[P0]])
2425
// SPVCHECK-NEXT: ret half [[ELT_ABS_I]]
2526
//
@@ -42,6 +43,7 @@ half test_length_half(half p0)
4243
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half2Dv2_Dh(
4344
// SPVCHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
4445
// SPVCHECK-NEXT: [[ENTRY:.*:]]
46+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
4547
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v2f16(<2 x half> [[P0]])
4648
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
4749
//
@@ -61,6 +63,7 @@ half test_length_half2(half2 p0)
6163
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half3Dv3_Dh(
6264
// SPVCHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
6365
// SPVCHECK-NEXT: [[ENTRY:.*:]]
66+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
6467
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v3f16(<3 x half> [[P0]])
6568
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
6669
//
@@ -80,6 +83,7 @@ half test_length_half3(half3 p0)
8083
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_length_half4Dv4_Dh(
8184
// SPVCHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
8285
// SPVCHECK-NEXT: [[ENTRY:.*:]]
86+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
8387
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef half @llvm.spv.length.v4f16(<4 x half> [[P0]])
8488
// SPVCHECK-NEXT: ret half [[SPV_LENGTH_I]]
8589
//
@@ -98,6 +102,7 @@ half test_length_half4(half4 p0)
98102
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z17test_length_floatf(
99103
// SPVCHECK-SAME: float noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
100104
// SPVCHECK-NEXT: [[ENTRY:.*:]]
105+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
101106
// SPVCHECK-NEXT: [[ELT_ABS_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.fabs.f32(float [[P0]])
102107
// SPVCHECK-NEXT: ret float [[ELT_ABS_I]]
103108
//
@@ -117,6 +122,7 @@ float test_length_float(float p0)
117122
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float2Dv2_f(
118123
// SPVCHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
119124
// SPVCHECK-NEXT: [[ENTRY:.*:]]
125+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
120126
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v2f32(<2 x float> [[P0]])
121127
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]
122128
//
@@ -136,6 +142,7 @@ float test_length_float2(float2 p0)
136142
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float3Dv3_f(
137143
// SPVCHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
138144
// SPVCHECK-NEXT: [[ENTRY:.*:]]
145+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
139146
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v3f32(<3 x float> [[P0]])
140147
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]
141148
//
@@ -155,6 +162,7 @@ float test_length_float3(float3 p0)
155162
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_length_float4Dv4_f(
156163
// SPVCHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[P0:%.*]]) local_unnamed_addr #[[ATTR0]] {
157164
// SPVCHECK-NEXT: [[ENTRY:.*:]]
165+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
158166
// SPVCHECK-NEXT: [[SPV_LENGTH_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef float @llvm.spv.length.v4f32(<4 x float> [[P0]])
159167
// SPVCHECK-NEXT: ret float [[SPV_LENGTH_I]]
160168
//

clang/test/CodeGenHLSL/builtins/reflect.hlsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) half @_Z17test_reflect_halfDhDh(
1919
// SPVCHECK-SAME: half noundef nofpclass(nan inf) [[I:%.*]], half noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
2020
// SPVCHECK-NEXT: [[ENTRY:.*:]]
21+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
2122
// SPVCHECK-NEXT: [[MUL_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half [[I]], 0xH4000
2223
// SPVCHECK-NEXT: [[TMP0:%.*]] = fmul reassoc nnan ninf nsz arcp afn half [[N]], [[N]]
2324
// SPVCHECK-NEXT: [[MUL2_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half [[TMP0]], [[MUL_I]]
@@ -42,6 +43,7 @@ half test_reflect_half(half I, half N) {
4243
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <2 x half> @_Z18test_reflect_half2Dv2_DhS_(
4344
// SPVCHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[I:%.*]], <2 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
4445
// SPVCHECK-NEXT: [[ENTRY:.*:]]
46+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
4547
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <2 x half> @llvm.spv.reflect.v2f16(<2 x half> [[I]], <2 x half> [[N]])
4648
// SPVCHECK-NEXT: ret <2 x half> [[SPV_REFLECT_I]]
4749
//
@@ -63,6 +65,7 @@ half2 test_reflect_half2(half2 I, half2 N) {
6365
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <3 x half> @_Z18test_reflect_half3Dv3_DhS_(
6466
// SPVCHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[I:%.*]], <3 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
6567
// SPVCHECK-NEXT: [[ENTRY:.*:]]
68+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
6669
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <3 x half> @llvm.spv.reflect.v3f16(<3 x half> [[I]], <3 x half> [[N]])
6770
// SPVCHECK-NEXT: ret <3 x half> [[SPV_REFLECT_I]]
6871
//
@@ -84,6 +87,7 @@ half3 test_reflect_half3(half3 I, half3 N) {
8487
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <4 x half> @_Z18test_reflect_half4Dv4_DhS_(
8588
// SPVCHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[I:%.*]], <4 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
8689
// SPVCHECK-NEXT: [[ENTRY:.*:]]
90+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
8791
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <4 x half> @llvm.spv.reflect.v4f16(<4 x half> [[I]], <4 x half> [[N]])
8892
// SPVCHECK-NEXT: ret <4 x half> [[SPV_REFLECT_I]]
8993
//
@@ -103,6 +107,7 @@ half4 test_reflect_half4(half4 I, half4 N) {
103107
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) float @_Z18test_reflect_floatff(
104108
// SPVCHECK-SAME: float noundef nofpclass(nan inf) [[I:%.*]], float noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
105109
// SPVCHECK-NEXT: [[ENTRY:.*:]]
110+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
106111
// SPVCHECK-NEXT: [[MUL_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[I]], 2.000000e+00
107112
// SPVCHECK-NEXT: [[TMP0:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[N]], [[N]]
108113
// SPVCHECK-NEXT: [[MUL2_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[TMP0]], [[MUL_I]]
@@ -127,6 +132,7 @@ float test_reflect_float(float I, float N) {
127132
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <2 x float> @_Z19test_reflect_float2Dv2_fS_(
128133
// SPVCHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[I:%.*]], <2 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
129134
// SPVCHECK-NEXT: [[ENTRY:.*:]]
135+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
130136
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <2 x float> @llvm.spv.reflect.v2f32(<2 x float> [[I]], <2 x float> [[N]])
131137
// SPVCHECK-NEXT: ret <2 x float> [[SPV_REFLECT_I]]
132138
//
@@ -148,6 +154,7 @@ float2 test_reflect_float2(float2 I, float2 N) {
148154
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <3 x float> @_Z19test_reflect_float3Dv3_fS_(
149155
// SPVCHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[I:%.*]], <3 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
150156
// SPVCHECK-NEXT: [[ENTRY:.*:]]
157+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
151158
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <3 x float> @llvm.spv.reflect.v3f32(<3 x float> [[I]], <3 x float> [[N]])
152159
// SPVCHECK-NEXT: ret <3 x float> [[SPV_REFLECT_I]]
153160
//
@@ -169,6 +176,7 @@ float3 test_reflect_float3(float3 I, float3 N) {
169176
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <4 x float> @_Z19test_reflect_float4Dv4_fS_(
170177
// SPVCHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[I:%.*]], <4 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
171178
// SPVCHECK-NEXT: [[ENTRY:.*:]]
179+
// SPVCHECK-NEXT: {{.*}} = tail call token @llvm.experimental.convergence.entry()
172180
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <4 x float> @llvm.spv.reflect.v4f32(<4 x float> [[I]], <4 x float> [[N]])
173181
// SPVCHECK-NEXT: ret <4 x float> [[SPV_REFLECT_I]]
174182
//

0 commit comments

Comments
 (0)