Skip to content

Commit f55b82b

Browse files
committed
Fix to force compilers to hoist blocks outside branches
1 parent 50f92ef commit f55b82b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/Feature/MaximalReconvergence/subgroup_uniform_control_flow.test

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ RWStructuredBuffer<float> Out : register(u0);
88
[numthreads(8,1,1)]
99
void main(uint3 TID : SV_GroupThreadID) {
1010
float maxActiveLaneCount = min(WaveActiveSum(1), 8);
11-
float div1 = 1.0/maxActiveLaneCount;
12-
float div2 = 2.0/maxActiveLaneCount;
1311
float div4 = 4.0/maxActiveLaneCount;
1412
float div8 = 8.0/maxActiveLaneCount;
1513

@@ -24,11 +22,11 @@ void main(uint3 TID : SV_GroupThreadID) {
2422
result += WaveActiveSum(div8);
2523
}
2624
// Must reconverge here with maximal reconvergence
27-
result += WaveActiveSum(div2);
25+
result += WaveActiveSum(div8);
2826
}
2927

3028
// Must reconverge here with maximal reconvergence
31-
result += WaveActiveSum(div1);
29+
result += WaveActiveSum(div8);
3230
Out[TID.x] = result;
3331
}
3432

@@ -60,13 +58,10 @@ DescriptorSets:
6058
# BUG: https://github.com/llvm/llvm-project/issues/165288
6159
# XFAIL: !WARP && Clang && (DirectX || Metal)
6260

63-
# BUG: https://github.com/llvm/llvm-project/issues/99159
64-
# XFAIL: Clang
65-
6661
# RUN: split-file %s %t
6762
# RUN: %dxc_target -T cs_6_0 -fspv-enable-maximal-reconvergence -Fo %t.o %t/source.hlsl
6863
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s
6964

7065
# CHECK: Name: Out
7166
# CHECK: Format: Float32
72-
# CHECK: Data: [ 3, 1, 4, 1, 3, 1, 4, 1 ]
67+
# CHECK: Data: [ 13, 8, 14, 8, 13, 8, 14, 8 ]

0 commit comments

Comments
 (0)