Skip to content

Commit dd6eff1

Browse files
committed
Address comments
1 parent fcd1949 commit dd6eff1

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19113,14 +19113,9 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
1911319113
llvm::Type *Ty = Op->getType();
1911419114
assert(Ty->isIntegerTy(1) && "wave_active_any_true operand must be a bool");
1911519115

19116-
llvm::FunctionType *FT =
19117-
llvm::FunctionType::get(Ty, {Ty}, /*isVarArg=*/false);
19118-
llvm::StringRef Name = Intrinsic::getName(
19119-
CGM.getHLSLRuntime().getWaveActiveAnyTrueIntrinsic());
19120-
return EmitRuntimeCall(CGM.CreateRuntimeFunction(FT, Name, {},
19121-
/*Local=*/false,
19122-
/*AssumeConvergent=*/true),
19123-
{Op}, "hlsl.wave.activeanytrue");
19116+
Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveActiveAnyTrueIntrinsic();
19117+
return EmitRuntimeCall(
19118+
Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID), {Op});
1912419119
}
1912519120
case Builtin::BI__builtin_hlsl_wave_active_count_bits: {
1912619121
Value *OpExpr = EmitScalarExpr(E->getArg(0));

clang/test/CodeGenHLSL/builtins/WaveActiveAnyTrue.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ bool test(bool p1) {
1313
// CHECK-SPIRV: %[[RET:.*]] = call spir_func i1 @llvm.spv.wave.activeanytrue(i1 %{{[a-zA-Z0-9]+}}) [ "convergencectrl"(token %[[#entry_tok0]]) ]
1414
// CHECK-DXIL: %[[RET:.*]] = call i1 @llvm.dx.wave.activeanytrue(i1 %{{[a-zA-Z0-9]+}})
1515
// CHECK: ret i1 %[[RET]]
16+
// CHECK: fex
1617
return WaveActiveAnyTrue(p1);
1718
}

clang/test/SemaHLSL/BuiltIns/WaveActiveAnyTrue-errors.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct Foo
1515
int a;
1616
};
1717

18-
bool test_type_check_2(Foo p0) {
18+
bool test_type_check(Foo p0) {
1919
return __builtin_hlsl_wave_active_any_true(p0);
2020
// expected-error@-1 {{no viable conversion from 'Foo' to 'bool'}}
2121
}

0 commit comments

Comments
 (0)