Skip to content
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

Handle compilation of various inline types #4910

Closed
Tracked by #4877
vezenovm opened this issue Apr 24, 2024 · 0 comments · Fixed by #4913
Closed
Tracked by #4877

Handle compilation of various inline types #4910

vezenovm opened this issue Apr 24, 2024 · 0 comments · Fixed by #4913
Labels
compiler enhancement New feature or request

Comments

@vezenovm
Copy link
Contributor

Problem

In order to support attributes like #[inline(never)] the frontend needs its own InlineType similar to what we have in SSA. Currently we just check whether we have a #[fold] attribute and then that flag determines how we set the InlineType in SSA.

Happy Case

We should be able to compile multiple ACIR functions for a program like such:

fn main(x: Field, y: pub Field) {
    basic_check(x, y);
}

#[inline(never)]
fn basic_check(x: Field, y: Field) {
    assert(x != y);
}

Project Impact

Blocker

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@vezenovm vezenovm added enhancement New feature or request compiler labels Apr 24, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 25, 2024
# Description

## Problem\*

Resolves #4910 

## Summary\*

We add a new attribute `Inline(String)`. Currently we only support one
`InlineType` variant of `Never`. This PR also moves `InlineType` into
the monomorphization ast as its functionality is expected to be shared
across various frontend passes as well as the SSA/ACIR gen.

## Additional Context

I know there is some plans to split the AST off into its own crate as
per (#4852). This change
shouldn't affect make the split much more dififcult as the evaluator
already depends on the AST as the issue mentions and this `InlineType`
is pretty isolated in its usage.

## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [X] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant