[Mlir-commits] [mlir] [mlir][mesh] Add collective communication operations (PR #71960)

Mehdi Amini llvmlistbot at llvm.org
Wed Nov 15 22:56:37 PST 2023


================
@@ -129,6 +207,327 @@ MeshShardingAttr::verify(function_ref<InFlightDiagnostic()> emitError,
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// collective communication ops
+//===----------------------------------------------------------------------===//
+
+namespace {
+
+template <typename Op>
+LogicalResult verifyMeshSymbolUses(Op op, SymbolTableCollection &symbolTable) {
+  FlatSymbolRefAttr symbolAttr = op.getMeshAttr();
+  if (!symbolAttr) {
+    return op.emitError() << "Unspecified \"mesh\" symbol attribute.";
+  }
+  SymbolTableCollection symbolTableCollection;
+  mesh::ClusterOp mesh =
+      symbolTableCollection.lookupNearestSymbolFrom<mesh::ClusterOp>(
+          op.getOperation(), symbolAttr);
----------------
joker-eph wrote:

Yes: `verifySymbolUses` is meant to be able to build a symbol table once and forall to avoid repeated traversal of the IR.

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


More information about the Mlir-commits mailing list