Skip to content

Commit

Permalink
[mlir][openacc][NFC] Rename custom parser from WaitOperands to Device…
Browse files Browse the repository at this point in the history
…TypeOperandsWithSegment
  • Loading branch information
clementval committed Jan 4, 2024
1 parent c041fa1 commit 85939e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 5 additions & 4 deletions mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ def OpenACC_ParallelOp : OpenACC_Op<"parallel",
`)`
| `vector_length` `(` custom<DeviceTypeOperands>($vectorLength,
type($vectorLength), $vectorLengthDeviceType) `)`
| `wait` `(` custom<WaitOperands>($waitOperands,
| `wait` `(` custom<DeviceTypeOperandsWithSegment>($waitOperands,
type($waitOperands), $waitOperandsDeviceType, $waitOperandsSegments) `)`
| `self` `(` $selfCond `)`
| `if` `(` $ifCond `)`
Expand Down Expand Up @@ -1075,7 +1075,7 @@ def OpenACC_SerialOp : OpenACC_Op<"serial",
| `private` `(` custom<SymOperandList>(
$gangPrivateOperands, type($gangPrivateOperands), $privatizations)
`)`
| `wait` `(` custom<WaitOperands>($waitOperands,
| `wait` `(` custom<DeviceTypeOperandsWithSegment>($waitOperands,
type($waitOperands), $waitOperandsDeviceType, $waitOperandsSegments) `)`
| `self` `(` $selfCond `)`
| `if` `(` $ifCond `)`
Expand Down Expand Up @@ -1196,8 +1196,9 @@ def OpenACC_KernelsOp : OpenACC_Op<"kernels",
type($numWorkers), $numWorkersDeviceType) `)`
| `vector_length` `(` custom<DeviceTypeOperands>($vectorLength,
type($vectorLength), $vectorLengthDeviceType) `)`
| `wait` `(` custom<WaitOperands>($waitOperands,
type($waitOperands), $waitOperandsDeviceType, $waitOperandsSegments) `)`
| `wait` `(` custom<DeviceTypeOperandsWithSegment>($waitOperands,
type($waitOperands), $waitOperandsDeviceType,
$waitOperandsSegments) `)`
| `self` `(` $selfCond `)`
| `if` `(` $ifCond `)`
)
Expand Down
11 changes: 5 additions & 6 deletions mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ static void printNumGangs(mlir::OpAsmPrinter &p, mlir::Operation *op,
}
}

static ParseResult parseWaitOperands(
static ParseResult parseDeviceTypeOperandsWithSegment(
mlir::OpAsmParser &parser,
llvm::SmallVectorImpl<mlir::OpAsmParser::UnresolvedOperand> &operands,
llvm::SmallVectorImpl<Type> &types, mlir::ArrayAttr &deviceTypes,
Expand Down Expand Up @@ -918,11 +918,10 @@ static ParseResult parseWaitOperands(
return success();
}

static void printWaitOperands(mlir::OpAsmPrinter &p, mlir::Operation *op,
mlir::OperandRange operands,
mlir::TypeRange types,
std::optional<mlir::ArrayAttr> deviceTypes,
std::optional<mlir::DenseI32ArrayAttr> segments) {
static void printDeviceTypeOperandsWithSegment(
mlir::OpAsmPrinter &p, mlir::Operation *op, mlir::OperandRange operands,
mlir::TypeRange types, std::optional<mlir::ArrayAttr> deviceTypes,
std::optional<mlir::DenseI32ArrayAttr> segments) {
unsigned opIdx = 0;
for (unsigned i = 0; i < deviceTypes->size(); ++i) {
if (i != 0)
Expand Down

0 comments on commit 85939e5

Please sign in to comment.