Skip to content

Commit 690730e

Browse files
committed
fix build
1 parent 737aa73 commit 690730e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

clang/lib/CodeGen/CGHLSLBuiltins.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,23 @@ static Intrinsic::ID getFirstBitHighIntrinsic(CGHLSLRuntime &RT, QualType QT) {
240240
return RT.getFirstBitUHighIntrinsic();
241241
}
242242

243+
// Return wave active sum that corresponds to the QT scalar type
244+
static Intrinsic::ID getWaveActiveSumIntrinsic(llvm::Triple::ArchType Arch,
245+
CGHLSLRuntime &RT, QualType QT) {
246+
switch (Arch) {
247+
case llvm::Triple::spirv:
248+
return Intrinsic::spv_wave_reduce_sum;
249+
case llvm::Triple::dxil: {
250+
if (QT->isUnsignedIntegerType())
251+
return Intrinsic::dx_wave_reduce_usum;
252+
return Intrinsic::dx_wave_reduce_sum;
253+
}
254+
default:
255+
llvm_unreachable("Intrinsic WaveActiveSum"
256+
" not supported by target architecture");
257+
}
258+
}
259+
243260
// Return wave active product that corresponds to the QT scalar type
244261
static Intrinsic::ID getWaveActiveProductIntrinsic(llvm::Triple::ArchType Arch,
245262
CGHLSLRuntime &RT, QualType QT) {

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class CGHLSLRuntime {
150150
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
151151
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveGetLaneCount, wave_get_lane_count)
152152
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, wave_readlane)
153-
GENERATE_HLSL_INTRINSIC_FUNCTION_UNSIGNED(WaveActiveSum, wave_reduce_sum, true, false);
154153
GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitUHigh, firstbituhigh)
155154
GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitSHigh, firstbitshigh)
156155
GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitLow, firstbitlow)

0 commit comments

Comments
 (0)