[Mlir-commits] [mlir] [mlir][mesh] Use tensor shape notation for the shape of a cluster (PR #73826)

Boian Petkantchin llvmlistbot at llvm.org
Tue Dec 5 10:11:34 PST 2023


================
@@ -3911,3 +3930,39 @@ void Block::printAsOperand(raw_ostream &os, AsmState &state) {
   OperationPrinter printer(os, state.getImpl());
   printer.printBlockName(this);
 }
+
+//===--------------------------------------------------------------------===//
+// Custom printers and parsers.
+//===--------------------------------------------------------------------===//
+namespace mlir {
+
+void printShape(OpAsmPrinter &printer, Operation *op, ArrayRef<int64_t> shape) {
+  if (!shape.empty())
+    printer << "[";
----------------
sogartar wrote:

Right. I added tests. There was actually a logic error in the `if (!shape.empty())` check. It should be `if (shape.empty())`.

https://github.com/llvm/llvm-project/pull/73826


More information about the Mlir-commits mailing list