Skip to content

Commit a2c1ff1

Browse files
[mlir][acc] Use consistent name for device_num operand (#136745)
`acc.set`, `acc.init`, and `acc.shutdown` take a `device_num` operand. However, this was named inconsistently. Give it the same consistent name for all aforementioned operations. --------- Co-authored-by: erichkeane <[email protected]>
1 parent 52cb1c9 commit a2c1ff1

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,7 @@ class OpenACCClauseCIREmitter final
291291
}
292292

293293
void VisitDeviceNumClause(const OpenACCDeviceNumClause &clause) {
294-
if constexpr (isOneOfTypes<OpTy, InitOp, ShutdownOp>) {
295-
operation.getDeviceNumOperandMutable().append(
296-
createIntExpr(clause.getIntExpr()));
297-
} else if constexpr (isOneOfTypes<OpTy, SetOp>) {
298-
// This is only a separate case because the getter name is different in
299-
// 'set' for some reason.
294+
if constexpr (isOneOfTypes<OpTy, InitOp, ShutdownOp, SetOp>) {
300295
operation.getDeviceNumMutable().append(
301296
createIntExpr(clause.getIntExpr()));
302297
} else {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,11 +2611,11 @@ def OpenACC_InitOp : OpenACC_Op<"init", [AttrSizedOperandSegments]> {
26112611
}];
26122612

26132613
let arguments = (ins OptionalAttr<TypedArrayAttrBase<OpenACC_DeviceTypeAttr, "Device type attributes">>:$device_types,
2614-
Optional<IntOrIndex>:$deviceNumOperand,
2614+
Optional<IntOrIndex>:$deviceNum,
26152615
Optional<I1>:$ifCond);
26162616

26172617
let assemblyFormat = [{
2618-
oilist(`device_num` `(` $deviceNumOperand `:` type($deviceNumOperand) `)`
2618+
oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`
26192619
| `if` `(` $ifCond `)`
26202620
) attr-dict-with-keyword
26212621
}];
@@ -2642,11 +2642,11 @@ def OpenACC_ShutdownOp : OpenACC_Op<"shutdown", [AttrSizedOperandSegments]> {
26422642
}];
26432643

26442644
let arguments = (ins OptionalAttr<TypedArrayAttrBase<OpenACC_DeviceTypeAttr, "Device type attributes">>:$device_types,
2645-
Optional<IntOrIndex>:$deviceNumOperand,
2645+
Optional<IntOrIndex>:$deviceNum,
26462646
Optional<I1>:$ifCond);
26472647

26482648
let assemblyFormat = [{
2649-
oilist(`device_num` `(` $deviceNumOperand `:` type($deviceNumOperand) `)`
2649+
oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`
26502650
|`if` `(` $ifCond `)`
26512651
) attr-dict-with-keyword
26522652
}];

0 commit comments

Comments
 (0)