[clang] [llvm] [HLSL] Add wave prefix count bits function (PR #178059)
Tex Riddell via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 28 10:02:40 PST 2026
================
@@ -2715,6 +2718,56 @@ bool SPIRVInstructionSelector::selectWaveActiveCountBits(
return Result;
}
+bool SPIRVInstructionSelector::selectWavePrefixBitCount(
+ Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const {
+
+ assert(I.getNumOperands() == 3);
+
+ auto Op = I.getOperand(2);
+ assert(Op.isReg());
+
+ MachineBasicBlock &BB = *I.getParent();
+ DebugLoc DL = I.getDebugLoc();
+
+ Register InputRegister = Op.getReg();
+ SPIRVType *InputType = GR.getSPIRVTypeForVReg(InputRegister);
+
+ if (!InputType)
+ report_fatal_error("Input Type could not be determined.");
+
+ if (!GR.isScalarOrVectorOfType(InputRegister, SPIRV::OpTypeBool))
----------------
tex3d wrote:
Should this really support vector input, when the HLSL intrinsic and builtin does not?
https://github.com/llvm/llvm-project/pull/178059
More information about the llvm-commits
mailing list