Skip to content

Commit 3b63a3a

Browse files
committed
formatting
1 parent 845256b commit 3b63a3a

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18963,15 +18963,24 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
1896318963
case Builtin::BI__builtin_hlsl_wave_active_any_true: {
1896418964
// Assert Op->getType() == Bool
1896518965

18966-
// FIXME: PR Question: Can this be simpler? Looks like Int1Ty isn't predefined
18967-
IntegerType* Int1Ty = llvm::Type::getInt1Ty(CGM.getTypes().getLLVMContext());
18966+
// FIXME: PR Question: Can this be simpler? Looks like Int1Ty isn't
18967+
// predefined
18968+
IntegerType *Int1Ty =
18969+
llvm::Type::getInt1Ty(CGM.getTypes().getLLVMContext());
1896818970
Value *Op = EmitScalarExpr(E->getArg(0));
18969-
assert(Op->getType() == Int1Ty && "wave_active_any_true operand must be a bool");
18970-
18971-
// FIXME: PR Question: Re Style SingleRef vs {SingleRef} vs ArrayRef{SingleRef}
18972-
llvm::FunctionType *FT = llvm::FunctionType::get(Int1Ty, {Int1Ty}, /*isVarArg=*/false);
18973-
llvm::StringRef Name = Intrinsic::getName(CGM.getHLSLRuntime().getWaveActiveAnyTrueIntrinsic());
18974-
return EmitRuntimeCall(CGM.CreateRuntimeFunction(FT, Name, {}, /*Local=*/false, /*AssumeConvergent=*/true), {Op}, "hlsl.wave.activeanytrue");
18971+
assert(Op->getType() == Int1Ty &&
18972+
"wave_active_any_true operand must be a bool");
18973+
18974+
// FIXME: PR Question: Re Style SingleRef vs {SingleRef} vs
18975+
// ArrayRef{SingleRef}
18976+
llvm::FunctionType *FT =
18977+
llvm::FunctionType::get(Int1Ty, {Int1Ty}, /*isVarArg=*/false);
18978+
llvm::StringRef Name = Intrinsic::getName(
18979+
CGM.getHLSLRuntime().getWaveActiveAnyTrueIntrinsic());
18980+
return EmitRuntimeCall(CGM.CreateRuntimeFunction(FT, Name, {},
18981+
/*Local=*/false,
18982+
/*AssumeConvergent=*/true),
18983+
{Op}, "hlsl.wave.activeanytrue");
1897518984
}
1897618985
case Builtin::BI__builtin_hlsl_wave_get_lane_index: {
1897718986
// We don't define a SPIR-V intrinsic, instead it is a SPIR-V built-in

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,10 +2067,10 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
20672067
break;
20682068
}
20692069
case Builtin::BI__builtin_hlsl_wave_active_any_true: {
2070-
if (SemaRef.checkArgCount(TheCall, 1))
2071-
return true;
2070+
if (SemaRef.checkArgCount(TheCall, 1))
2071+
return true;
20722072

2073-
break;
2073+
break;
20742074
}
20752075
case Builtin::BI__builtin_hlsl_wave_read_lane_at: {
20762076
if (SemaRef.checkArgCount(TheCall, 2))

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,8 +1766,8 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg,
17661766
}
17671767

17681768
bool SPIRVInstructionSelector::selectWaveActiveAnyTrue(Register ResVReg,
1769-
const SPIRVType *ResType,
1770-
MachineInstr &I) const {
1769+
const SPIRVType *ResType,
1770+
MachineInstr &I) const {
17711771
assert(I.getNumOperands() == 3);
17721772
assert(I.getOperand(2).isReg());
17731773

@@ -1776,8 +1776,7 @@ bool SPIRVInstructionSelector::selectWaveActiveAnyTrue(Register ResVReg,
17761776
MachineBasicBlock &BB = *I.getParent();
17771777
SPIRVType *IntTy = GR.getOrCreateSPIRVIntegerType(32, I, TII);
17781778

1779-
return BuildMI(BB, I, I.getDebugLoc(),
1780-
TII.get(SPIRV::OpGroupNonUniformAny))
1779+
return BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpGroupNonUniformAny))
17811780
.addDef(ResVReg)
17821781
.addUse(GR.getSPIRVTypeID(ResType))
17831782
.addUse(GR.getOrCreateConstInt(3, I, IntTy, TII))

0 commit comments

Comments
 (0)