https://github.com/erichkeane created 
https://github.com/llvm/llvm-project/pull/156465

As mentioned in a previous review, we aren't properly generating 
init/destroy/copy (combiner will need to be done correctly too!) regions for 
recipe generation. In the case where these have 'bounds', we can do a much 
better job of figuring out the type and how much needs to be done, but that is 
going to be its own engineering effort.

For now, add an NYI as a note to come back to this.

>From 683e76d5cdbb1b078866d9f92402b362005b80be Mon Sep 17 00:00:00 2001
From: erichkeane <eke...@nvidia.com>
Date: Tue, 2 Sep 2025 07:13:12 -0700
Subject: [PATCH] [OpenACC] Add NYI for pointer/VLA arguments to recipes

As mentioned in a previous review, we aren't properly generating
init/destroy/copy (combiner will need to be done correctly too!)
regions for recipe generation. In the case where these have 'bounds', we
can do a much better job of figuring out the type and how much needs to
be done, but that is going to be its own engineering effort.

For now, add an NYI as a note to come back to this.
---
 clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp 
b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
index 37533368af4b2..98e71b6609f0d 100644
--- a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
@@ -595,6 +595,20 @@ class OpenACCClauseCIREmitter final
                              OpenACCReductionOperator reductionOp,
                              DeclContext *dc, QualType baseType,
                              mlir::Value mainOp) {
+
+    if (baseType->isPointerType() ||
+        (baseType->isArrayType() && !baseType->isConstantArrayType())) {
+      // It is clear that the use of pointers/VLAs in a recipe are not properly
+      // generated/don't do what they are supposed to do.  In the case where we
+      // have 'bounds', we can actually figure out what we want to
+      // initialize/copy/destroy/compare/etc, but we haven't figured out how
+      // that looks yet, both between the IR and generation code.  For now, we
+      // will do an NYI error no it.
+      cgf.cgm.errorNYI(
+          varRef->getSourceRange(),
+          "OpenACC recipe generation for pointer/non-constant arrays");
+    }
+
     mlir::ModuleOp mod = builder.getBlock()
                              ->getParent()
                              ->template getParentOfType<mlir::ModuleOp>();

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to