Skip to content

Rewrite rule from scf to cf #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

weinbe58
Copy link
Member

this PR implements the rewrite rule from SCF to CF dialect.

This rule must be applied in a fixed point fashion and works by walking a ssacfg region looking for scf.For and scf.IfElse. when if finds these statements it inserts their body blocks and uses cf to create the appropriate cfg for those statements. This only implements it for one level of nesting; hence, it should be applied in a fixed-point fashion.

@weinbe58 weinbe58 linked an issue May 13, 2025 that may be closed by this pull request
@weinbe58 weinbe58 marked this pull request as draft May 13, 2025 20:38
Copy link
Contributor

github-actions bot commented May 13, 2025

PR Preview Action v1.6.1

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

Built to branch gh-pages at 2025-05-15 01:52 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

weinbe58 and others added 4 commits May 14, 2025 17:07
function can have a return value even when we are talking about Python
functions, e.g when one write

```python
def foo(x: int):
    pass
```

we can interpret this as assigning a value of `Method` to the variable
`foo`. This makes downstream analysis and codegen easier because now we
have a place to store what the function represents
@weinbe58 weinbe58 requested a review from Roger-luo May 15, 2025 01:47
@weinbe58 weinbe58 marked this pull request as ready for review May 15, 2025 01:55
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.

rewrite rule from SCF to CF
2 participants