[clang] [llvm] [HLSL][DXIL][SPRIV] Added WaveActiveMin intrinsic (PR #164385)

Sietze Riemersma via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 21 09:05:08 PDT 2025


================
@@ -225,6 +215,25 @@ static Intrinsic::ID getWaveActiveMaxIntrinsic(llvm::Triple::ArchType Arch,
   }
 }
 
+// Return wave active min that corresponds to the QT scalar type
+static Intrinsic::ID getWaveActiveMinIntrinsic(llvm::Triple::ArchType Arch,
+                                               CGHLSLRuntime &RT, QualType QT) {
+  switch (Arch) {
+  case llvm::Triple::spirv:
+    if (QT->isUnsignedIntegerType())
+      return Intrinsic::spv_wave_reduce_umin;
----------------
KungFuDonkey wrote:

That is because of the conditional for unsigned integers (min vs umin). We'd need to add a macro that can do that, but this would for instance not handle the Sum, which would need its own macro...

I'd rather not try to figure that out here

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


More information about the cfe-commits mailing list