Skip to content

Commit 916741e

Browse files
committed
Add create overload to RoutineOp to 'set nothing'
1 parent 993f340 commit 916741e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

clang/lib/CIR/CodeGen/CIRGenDeclOpenACC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ void CIRGenModule::emitOpenACCRoutineDecl(
345345
// count on the visitor/emitter to fill these in.
346346
auto routineOp = mlir::acc::RoutineOp::create(
347347
builder, routineLoc, routineName,
348-
mlir::SymbolRefAttr::get(builder.getContext(), func.getName()), {}, {},
349-
{}, {}, {}, {}, {}, /*hasNoHost=*/false, /*implicit=*/false, {}, {}, {});
348+
mlir::SymbolRefAttr::get(builder.getContext(), func.getName()),
349+
/*implicit=*/false);
350350

351351
// We have to add a pointer going the other direction via an acc.routine_info,
352352
// from the func to the routine.

mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,6 +3232,18 @@ def OpenACC_RoutineOp : OpenACC_Op<"routine", [IsolatedFromAbove]> {
32323232
OptionalAttr<DeviceTypeArrayAttr>:$gangDimDeviceType);
32333233

32343234
let extraClassDeclaration = [{
3235+
// 'create' function to generate an 'empty' routine.
3236+
static RoutineOp create(::mlir::OpBuilder & builder,
3237+
::mlir::Location location,
3238+
::llvm::StringRef sym_name,
3239+
mlir::SymbolRefAttr func_name, bool implicit) {
3240+
return create(builder, location, sym_name, func_name, /*bindIDName=*/{},
3241+
/*bindStrName=*/{}, /*bindIdNameDeviceType=*/{},
3242+
/*bindStrnameDeviceType=*/{}, /*worker=*/{}, /*vector=*/{},
3243+
/*seq=*/{}, /*nohost=*/false, implicit, /*gang=*/{},
3244+
/*gangDim=*/{}, /*gangDimDeviceType=*/{});
3245+
}
3246+
32353247
static StringRef getGangDimKeyword() { return "dim"; }
32363248

32373249
/// Return true if the op has the worker attribute for the

0 commit comments

Comments
 (0)