[Mlir-commits] [mlir] 85939e5 - [mlir][openacc][NFC] Rename custom parser from WaitOperands to DeviceTypeOperandsWithSegment

Valentin Clement llvmlistbot at llvm.org
Thu Jan 4 10:28:49 PST 2024


Author: Valentin Clement
Date: 2024-01-04T10:28:37-08:00
New Revision: 85939e5e248213dfdf66fc8305ed502fc2f3f1f0

URL: https://github.com/llvm/llvm-project/commit/85939e5e248213dfdf66fc8305ed502fc2f3f1f0
DIFF: https://github.com/llvm/llvm-project/commit/85939e5e248213dfdf66fc8305ed502fc2f3f1f0.diff

LOG: [mlir][openacc][NFC] Rename custom parser from WaitOperands to DeviceTypeOperandsWithSegment

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
index 234c1076e14e3b..4312bd4de1bd4f 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
@@ -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 `)`
@@ -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 `)`
@@ -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 `)`
     )

diff  --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index f484eda3268db0..e299b67b10a9c7 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -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,
@@ -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)


        


More information about the Mlir-commits mailing list