[clang] [llvm] [HLSL][DXIL][SPIRV] Added WaveActiveBitOr HLSL intrinsic (PR #165156)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 29 12:53:27 PDT 2025


================
@@ -2427,6 +2430,32 @@ bool SPIRVInstructionSelector::selectWaveActiveCountBits(
   return Result;
 }
 
+bool SPIRVInstructionSelector::selectWaveReduceOr(
+    Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const {
+
+  assert(I.getNumOperands() == 3);
+  assert(I.getOperand(2).isReg());
+  MachineBasicBlock &BB = *I.getParent();
+  Register InputRegister = I.getOperand(2).getReg();
+  SPIRVType *InputType = GR.getSPIRVTypeForVReg(InputRegister);
+
+  if (!InputType)
+    report_fatal_error("Input Type could not be determined.");
----------------
farzonl wrote:

We don't typically do report faital error for this. also the error is pretty vague.  if this is a nullptr it means the register doesn't have a type assigned you should see many asserts that looks something like this:
`assert(InputType && "VReg has no type assigned");` please replace with an assert and indicate the issue is with the register.



https://github.com/llvm/llvm-project/pull/165156


More information about the cfe-commits mailing list