Skip to content

Commit 8293eeb

Browse files
Merge pull request #727 from TaoTao-real/codex/a5-bufid-sync
Add A5 bufid sync pass
2 parents 25d5e38 + 53755e5 commit 8293eeb

13 files changed

Lines changed: 2706 additions & 6 deletions

File tree

docs/bufid_sync_a5_design.md

Lines changed: 607 additions & 0 deletions
Large diffs are not rendered by default.

include/PTO/Transforms/Passes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ std::unique_ptr<Pass> createPTOVerifyTFreePass();
4444
// Creates a pass for ...
4545
std::unique_ptr<Pass> createPTOInsertSyncPass();
4646
std::unique_ptr<Pass> createPTOInjectBarrierAllSyncPass();
47+
std::unique_ptr<Pass>
48+
createPTOBufidSyncPass(const PTOBufidSyncOptions &options = {});
4749

4850
// Graph-based intra-core sync solver (coexists with PTOInsertSync).
4951
std::unique_ptr<Pass>

include/PTO/Transforms/Passes.td

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,30 @@ def PTOInjectBarrierAllSync : Pass<"pto-inject-barrier-all-sync", "func::FuncOp"
5757
];
5858
}
5959

60+
def PTOBufidSync : Pass<"pto-bufid-sync", "func::FuncOp"> {
61+
let summary = "Insert get_buf/rls_buf synchronization for PTO dialect";
62+
let description = [{
63+
Analyzes cross-pipeline local buffer dependencies and wraps dependent
64+
operations with A5 buffer-id synchronization. Unlike pto-insert-sync, this
65+
pass emits get_buf/rls_buf pairs instead of set_flag/wait_flag events.
66+
}];
67+
68+
let constructor = "mlir::pto::createPTOBufidSyncPass()";
69+
70+
let options = [
71+
Option<"enableBufidSyncDebug", "enable-bufid-sync-debug",
72+
"bool", "false",
73+
"Enable verbose debug printing for the bufid_sync pass">
74+
];
75+
76+
let dependentDialects = [
77+
"mlir::pto::PTODialect",
78+
"mlir::memref::MemRefDialect",
79+
"mlir::arith::ArithDialect",
80+
"mlir::scf::SCFDialect"
81+
];
82+
}
83+
6084
// Define PTOGraphSyncSolver Pass (graph-based intra-core sync solver).
6185
// Coexists with PTOInsertSync; selectable via the driver flag
6286
// `--enable-graph-sync-solver`. Ported from bishengir's GraphSyncSolver core:

0 commit comments

Comments
 (0)