Skip to content

Commit 8ac6052

Browse files
V-FEXrtGreg Roth
andauthored
Apply suggestions from code review
Co-authored-by: Greg Roth <[email protected]>
1 parent e616b31 commit 8ac6052

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

clang/test/CodeGenHLSL/builtins/WaveActiveAnyTrue.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Test basic lowering to runtime function call for int values.
99

10-
// CHECK-LABEL: test
10+
// CHECK-LABEL: define {{.*}}test
1111
bool test(bool p1) {
1212
// CHECK-SPIRV: %[[#entry_tok0:]] = call token @llvm.experimental.convergence.entry()
1313
// CHECK-SPIRV: %[[RET:.*]] = call spir_func i1 @llvm.spv.wave.any(i1 %{{[a-zA-Z0-9]+}}) [ "convergencectrl"(token %[[#entry_tok0]]) ]

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,8 @@ bool SPIRVInstructionSelector::selectWaveActiveAnyTrue(Register ResVReg,
19651965
.addDef(ResVReg)
19661966
.addUse(GR.getSPIRVTypeID(ResType))
19671967
.addUse(GR.getOrCreateConstInt(SPIRV::Scope::Subgroup, I, IntTy, TII))
1968-
.addUse(I.getOperand(2).getReg());
1968+
.addUse(I.getOperand(2).getReg())
1969+
.constrainAllUses(TII, TRI, RBI);
19691970
}
19701971

19711972
bool SPIRVInstructionSelector::selectWaveActiveCountBits(

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveAnyTrue.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
22
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
33

4-
; CHECK: %[[#bool:]] = OpTypeBool
5-
; CHECK: %[[#uint:]] = OpTypeInt 32 0
6-
; CHECK: %[[#scope:]] = OpConstant %[[#uint]] 3
4+
; CHECK-DAG: %[[#bool:]] = OpTypeBool
5+
; CHECK-DAG: %[[#uint:]] = OpTypeInt 32 0
6+
; CHECK-DAG: %[[#scope:]] = OpConstant %[[#uint]] 3
77

88
; CHECK-LABEL: Begin function test_wave_any
99
define i1 @test_wave_any(i1 %p1) {

0 commit comments

Comments
 (0)