[clang] [llvm] [HLSL] Add wave prefix count bits function (PR #178059)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 29 10:54:09 PST 2026


================
@@ -384,6 +384,19 @@ static Intrinsic::ID getWaveActiveMinIntrinsic(llvm::Triple::ArchType Arch,
   }
 }
 
+static Intrinsic::ID getPrefixCountBitsIntrinsic(llvm::Triple::ArchType Arch) {
+  switch (Arch) {
+  case llvm::Triple::spirv:
+    return Intrinsic::spv_subgroup_prefix_bit_count;
+  case llvm::Triple::dxil: {
+    return Intrinsic::dx_wave_prefix_bit_count;
----------------
inbelic wrote:

nit:

Is this/will this be a common pattern in intrinsic defs? The subgroup_ and wave_ followed by a common name? If so it might make sense to have a similar `GENERATE_HLSL_INTRINSIC_FUNCTION` macro for this case?

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


More information about the cfe-commits mailing list