Skip to content

Neelay/fix post inference#617

Open
neelay893 wants to merge 2 commits into
mainfrom
neelay/fix-post-inference
Open

Neelay/fix post inference#617
neelay893 wants to merge 2 commits into
mainfrom
neelay/fix-post-inference

Conversation

@neelay893

Copy link
Copy Markdown
Contributor

The post_inference pass (set of rewrite rules that runs after TypeInfer) was configured such that the registered rewrite rules would not actually walk the IR; this PR changes (rule.rewrite(mt.code).join(result)) to Walk(rule).rewrite(mt.code).join(result)).

@neelay893
neelay893 requested review from Roger-luo and kaihsin and removed request for kaihsin March 4, 2026 20:08
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11405 10273 90% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/kirin/dialects/vmath/rewrites/desugar.py 76% 🟢
src/kirin/passes/post_inference.py 100% 🟢
TOTAL 88% 🟢

updated for commit: beaa733 by action🐍

@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://QuEraComputing.github.io/kirin/pr-preview/pr-617/

Built to branch gh-pages at 2026-03-04 20:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Roger-luo

Copy link
Copy Markdown
Collaborator

this was intentional so you have to use Walk to traverse the IR (some rule may have their own order to traverse)

@neelay893

Copy link
Copy Markdown
Contributor Author

Then maybe we need to change how rewrite rules are being registered as post-inference (as is the case with vmath desugar https://github.com/QuEraComputing/kirin/blob/main/src/kirin/dialects/vmath/rewrites/desugar.py#L61)? I first noticed this when an ilist.map wasn't being unrolled, even though Unroll is registered as post-inference. cc @Roger-luo

@Roger-luo Roger-luo added area: compiler pass Area: compiler pass related issues. category: enhancement Category: this is an enhancement of an existing feature. labels Apr 7, 2026
@Roger-luo Roger-luo added the priority: low Priority: low priority issues and tasks, backlogs, good-to-haves. label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler pass Area: compiler pass related issues. category: enhancement Category: this is an enhancement of an existing feature. priority: low Priority: low priority issues and tasks, backlogs, good-to-haves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants