[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:10 PST 2026


================
@@ -3607,6 +3607,28 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
       return true;
     break;
   }
+  case Builtin::BI__builtin_hlsl_wave_prefix_count_bits: {
+    if (SemaRef.checkArgCount(TheCall, 1))
+      return true;
+
+    QualType ArgType = TheCall->getArg(0)->getType();
+
+    if (!(ArgType->isScalarType())) {
----------------
inbelic wrote:

nit: I think you can use the `CheckScalarOrVector` helper function to do these checks

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


More information about the cfe-commits mailing list