Skip to content

feat(pto): implement tpush/tpop direct TPipe flow#213

Draft
KurrinQu wants to merge 1 commit intozhangstevenunity:mainfrom
KurrinQu:feature/tpush-tpop-ops
Draft

feat(pto): implement tpush/tpop direct TPipe flow#213
KurrinQu wants to merge 1 commit intozhangstevenunity:mainfrom
KurrinQu:feature/tpush-tpop-ops

Conversation

@KurrinQu
Copy link

@KurrinQu KurrinQu commented Mar 7, 2026

No description provided.

@KurrinQu KurrinQu force-pushed the feature/tpush-tpop-ops branch 3 times, most recently from 96533eb to 25c8b89 Compare March 9, 2026 01:00
@KurrinQu KurrinQu force-pushed the feature/tpush-tpop-ops branch 3 times, most recently from 426433c to 13fad76 Compare March 10, 2026 15:09
@zhangstevenunity
Copy link
Owner

@codex

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30d617d5ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +28 to +30
if (auto tfreeOp = dyn_cast<TFreeOp>(&*it)) {
if (tfreeOp.getPipeHandle() == pipeHandle)
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Match existing tfree to the current tpop, not just the pipe

This early-exit treats any later pto.tfree with the same pipe as covering the current pto.tpop, which is incorrect when a block has multiple tpop operations on one pipe. In that case, an explicit tfree intended for a later pop makes earlier pops skip auto-insertion, so some consumed slots are never released on A5 and FIFO progress can stall. The check needs to distinguish per-pop balancing instead of a boolean per pipe.

Useful? React with 👍 / 👎.

Comment on lines +42 to +43
for (auto it = std::next(startOp->getIterator()), end = block->end();
it != end; ++it) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Track tile reads through nested regions before inserting tfree

The last-read search only walks sibling operations in the same block, so reads inside nested regions (for example scf.if/scf.for bodies after the tpop) are not considered. When that happens, lastRead stays null and tfree is inserted immediately after tpop, releasing the slot before nested consumers run, which can corrupt A5 pipe usage. This needs region-aware read tracking rather than top-level block scanning only.

Useful? React with 👍 / 👎.

Comment on lines +3881 to +3884
if (fifoAddrs.empty())
return rewriter.notifyMatchFailure(
op, "fifo_addrs must be present at EmitC lowering "
"(plan memory pass should have filled it in)");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep LOCAL initialize_pipe optionality consistent through lowering

Verifier logic allows location=LOCAL with zero fifo_addrs, but EmitC lowering unconditionally fails when the operand list is empty. That makes IR accepted by verification fail later in conversion ("fifo_addrs must be present ..."), which is a pipeline regression for the documented optional LOCAL form. Either require the operand up front in verifier/pipeline modes that cannot materialize it, or implement the missing materialization before this check.

Useful? React with 👍 / 👎.

@KurrinQu KurrinQu force-pushed the feature/tpush-tpop-ops branch 7 times, most recently from e13a435 to 4076a96 Compare March 13, 2026 13:00
@KurrinQu KurrinQu force-pushed the feature/tpush-tpop-ops branch from 4076a96 to a9da4f1 Compare March 13, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants