================ @@ -157,6 +222,103 @@ class OpenACCClauseCIREmitter final computeEmitter.Visit(&c); } + template <typename BeforeOpTy, typename AfterOpTy> + void addDataOperand(const Expr *varOperand, mlir::acc::DataClause dataClause, + bool structured, bool implicit) { + DataOperandInfo opInfo = + getDataOperandInfo(cgf, builder, dirKind, varOperand); + + // TODO: OpenACC: we should comprehend the 'modifier-list' here for the data + // operand. At the moment, we don't have a uniform way to assign these + // properly, and the dialect cannot represent anything other than 'readonly' + // and 'zero' on copyin/copyout/create, so for now, we skip it. + + auto beforeOp = + builder.create<BeforeOpTy>(opInfo.beginLoc, opInfo.varValue, structured, + implicit, opInfo.name, opInfo.bounds); + operation.getDataClauseOperandsMutable().append(beforeOp.getResult()); + + AfterOpTy afterOp; + { + mlir::OpBuilder::InsertionGuard guardCase(builder); + builder.setInsertionPointAfter(operation); + afterOp = builder.create<AfterOpTy>(opInfo.beginLoc, beforeOp.getResult(), + opInfo.varValue, structured, implicit, ---------------- erichkeane wrote:
DOES the 'implicit' and 'structured' ALWAYS match the 'before'? Or do I need a separate variable for that @razvanlupusoru and @clementval ? https://github.com/llvm/llvm-project/pull/140304 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits