[clang] [OpenACC][CIR] Finish 'private' recipe lowering by doing 'init' (PR #161540)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 1 10:55:20 PDT 2025
================
@@ -400,6 +400,33 @@ void OpenACCRecipeBuilderBase::createRecipeDestroySection(
mlir::acc::YieldOp::create(builder, locEnd);
}
+void OpenACCRecipeBuilderBase::makeBoundsInit(
+ mlir::Value alloca, mlir::Location loc, mlir::Block *block,
+ const VarDecl *allocaDecl, QualType origType, const Expr *initExpr,
+ bool isInitSection) {
+ mlir::OpBuilder::InsertionGuard guardCase(builder);
+ builder.setInsertionPointToEnd(block);
+ CIRGenFunction::LexicalScope ls(cgf, loc, block);
+
+ CIRGenFunction::AutoVarEmission tempDeclEmission{*allocaDecl};
+ tempDeclEmission.EmittedAsOffload = true;
+
+ // The init section is the only one of the handful that only has a single
+ // argument for the 'type', so we have to drop 1 for init, and future calls
+ // to this will need to drop 2.
----------------
erichkeane wrote:
They are both the 'allocated thing'. See the `bb0` bits in the test.
The `init` region has a signature of:
`bb0(<thing>, bounds-list)`.
The 'copy' has:
`bb0(src, dest, bounds-list)`.
So the call to this for firstprivate (which uses the 'copy' region) will need to snip off both the src and dest, instead of just the 'one version' of the thing.
https://github.com/llvm/llvm-project/pull/161540
More information about the cfe-commits
mailing list