[Mlir-commits] [mlir] d7565de - [MLIR] NFC. Drop trailing white space in GPU async ops print

Uday Bondhugula llvmlistbot at llvm.org
Wed Apr 20 05:29:20 PDT 2022


Author: Uday Bondhugula
Date: 2022-04-20T17:56:53+05:30
New Revision: d7565de6cc6ba4de8a5d73282281ff95d7a0ad46

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

LOG: [MLIR] NFC. Drop trailing white space in GPU async ops print

NFC. Drop trailing end of line white space in GPU async ops' printer
whenever the list of async deps is empty.

Reviewed By: mehdi_amini, rriddle

Differential Revision: https://reviews.llvm.org/D123754

Added: 
    

Modified: 
    mlir/lib/Dialect/GPU/IR/GPUDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 95c8a352e834f..76e477c2dd740 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -1052,16 +1052,21 @@ static ParseResult parseAsyncDependencies(
                                  OpAsmParser::Delimiter::OptionalSquare);
 }
 
+/// Prints optional async dependencies with its leading keyword.
+///   (`async`)? (`[` ssa-id-list `]`)?
+// Used by the tablegen assembly format for several async ops.
 static void printAsyncDependencies(OpAsmPrinter &printer, Operation *op,
                                    Type asyncTokenType,
                                    OperandRange asyncDependencies) {
   if (asyncTokenType)
-    printer << "async ";
+    printer << "async";
   if (asyncDependencies.empty())
     return;
-  printer << "[";
+  if (asyncTokenType)
+    printer << ' ';
+  printer << '[';
   llvm::interleaveComma(asyncDependencies, printer);
-  printer << "]";
+  printer << ']';
 }
 
 namespace {


        


More information about the Mlir-commits mailing list