[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 13:02:46 PDT 2024


================
@@ -1956,6 +1956,26 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
       return true;
     break;
   }
+  case Builtin::BI__builtin_hlsl_wave_read_lane_at: {
+    if (SemaRef.checkArgCount(TheCall, 2))
+      return true;
+
+    // Ensure index parameter type can be interpreted as a uint
+    ExprResult Index = TheCall->getArg(1);
+    QualType ArgTyIndex = Index.get()->getType();
+    if (!ArgTyIndex->hasIntegerRepresentation()) {
----------------
llvm-beanz wrote:

I don't think this is the correct check. This will return `true` for vectors of integers. I think we really want `isIntegerType()`.

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


More information about the cfe-commits mailing list