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

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 06:27:31 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;
----------------
s-perron wrote:

Is there a reason we cannot use a macro like these:

https://github.com/llvm/llvm-project/blob/88d303e6d42a17a5b1789f6f4b3a1b4ee98b5bf7/clang/lib/CodeGen/CGHLSLRuntime.h#L87.

That could simplify the logic there.

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


More information about the llvm-commits mailing list