Skip to content

Commit 4f98fb2

Browse files
authored
[mlir][openacc][NFC] Remove useless OptionalAttr with UnitAttr (llvm#68337)
`UnitAttr` exits or not so adding `OptionalAttr` around it is not necessary. This patch cleanup this for the `RoutineOp`
1 parent 3aa2bac commit 4f98fb2

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

flang/lib/Lower/OpenACC.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,9 +2981,8 @@ genACC(Fortran::lower::AbstractConverter &converter,
29812981
std::stringstream routineOpName;
29822982
routineOpName << accRoutinePrefix.str() << routineCounter++;
29832983
auto routineOp = modBuilder.create<mlir::acc::RoutineOp>(
2984-
loc, routineOpName.str(), funcName, mlir::StringAttr{}, mlir::UnitAttr{},
2985-
mlir::UnitAttr{}, mlir::UnitAttr{}, mlir::UnitAttr{}, mlir::UnitAttr{},
2986-
mlir::UnitAttr{}, mlir::IntegerAttr{});
2984+
loc, routineOpName.str(), funcName, mlir::StringAttr{}, false, false,
2985+
false, false, false, false, mlir::IntegerAttr{});
29872986

29882987
for (const Fortran::parser::AccClause &clause : clauses.v) {
29892988
if (std::get_if<Fortran::parser::AccClause::Seq>(&clause.u)) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,12 +1563,12 @@ def OpenACC_RoutineOp : OpenACC_Op<"routine", [IsolatedFromAbove]> {
15631563
let arguments = (ins SymbolNameAttr:$sym_name,
15641564
SymbolNameAttr:$func_name,
15651565
OptionalAttr<StrAttr>:$bind_name,
1566-
OptionalAttr<UnitAttr>:$gang,
1567-
OptionalAttr<UnitAttr>:$worker,
1568-
OptionalAttr<UnitAttr>:$vector,
1569-
OptionalAttr<UnitAttr>:$seq,
1570-
OptionalAttr<UnitAttr>:$nohost,
1571-
OptionalAttr<UnitAttr>:$implicit,
1566+
UnitAttr:$gang,
1567+
UnitAttr:$worker,
1568+
UnitAttr:$vector,
1569+
UnitAttr:$seq,
1570+
UnitAttr:$nohost,
1571+
UnitAttr:$implicit,
15721572
OptionalAttr<APIntAttr>:$gangDim);
15731573

15741574
let extraClassDeclaration = [{

0 commit comments

Comments
 (0)