Skip to content

Fixing & for C backend #1057

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

Merged
merged 3 commits into from
Aug 29, 2022
Merged

Fixing & for C backend #1057

merged 3 commits into from
Aug 29, 2022

Conversation

ronnuriel
Copy link
Collaborator

Signed-off-by: Ron Nuriel [email protected]

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

This looks good, thanks for the fix!

@certik certik force-pushed the feature/BitAnd_op branch from f21ddd7 to 693ed9f Compare August 29, 2022 12:48
@certik
Copy link
Contributor

certik commented Aug 29, 2022

@ronnuriel I merged the first two commits, and also added a new commit (693ed9f) that updates the reference tests, I just did:

./run_tests.py -u

and committed.

@certik certik enabled auto-merge August 29, 2022 13:02
@certik certik merged commit 78a008d into lcompilers:main Aug 29, 2022
@@ -4,13 +4,23 @@
def add(x: i32, y: i32) -> i32:
return x + y

@inline
def and_op(x: i32, y: i32) -> i32:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. I think this feature isn't available in LLVM backend yet (will confirm though). I will add the same (after confirming).

cc: @certik @ronnuriel @rebcabin

Copy link
Contributor

Choose a reason for hiding this comment

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

Go for it. Tests pass, but I assume LLVM ignores it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well I am wondering if we should use the function inline pass for this. A function will be inlined in LLVM backend if it's decorated with @inline. Make sense?

In --fast flag all functions (provided they satisfy some conditions) are anyways inlined automatically.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. LLVM ignores this decorator. Making it work via function inline pass.

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.

3 participants