[Mlir-commits] [mlir] [mlir][acc] Introduce createAndPopulate for recipe creation (PR #162917)

Valentin Clement バレンタイン クレメン llvmlistbot at llvm.org
Fri Oct 10 17:30:47 PDT 2025


================
@@ -1080,6 +1287,67 @@ LogicalResult acc::FirstprivateRecipeOp::verifyRegions() {
   return success();
 }
 
+std::optional<FirstprivateRecipeOp>
+FirstprivateRecipeOp::createAndPopulate(OpBuilder &builder, Location loc,
+                                        StringRef recipeName, Value var,
+                                        StringRef varName, ValueRange bounds) {
+
+  Type varType = var.getType();
+
+  // First, validate that we can handle this variable type
+  bool isMappable = isa<MappableType>(varType);
+  bool isPointerLike = isa<PointerLikeType>(varType);
+
+  if (!isMappable && !isPointerLike) {
+    // Unsupported type
+    return std::nullopt;
+  }
----------------
clementval wrote:

no brace

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


More information about the Mlir-commits mailing list