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

RCO too eager, interferes with explicate #181

Open
jsiek opened this issue Sep 28, 2024 · 1 comment
Open

RCO too eager, interferes with explicate #181

jsiek opened this issue Sep 28, 2024 · 1 comment

Comments

@jsiek
Copy link
Collaborator

jsiek commented Sep 28, 2024

For example,

print(42 if not (x == y) else 5)

compiles to more efficient code if RCO doesn't create a temporary for x == y.

@elavoie
Copy link

elavoie commented Oct 14, 2024

As discussed here: #179 (comment)

This can be solved by partially evaluating the not operation before the RCO pass, resulting in:

print(42 if x != y else 5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants