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

proposal: compiler/emitter: optimize if statements with constant condition #876

Open
zapateo opened this issue Sep 21, 2021 · 0 comments
Open
Labels
emitter/builder Related to VM's emitter and builder improvement An optional improvement proposal Proposal-Accepted

Comments

@zapateo
Copy link
Member

zapateo commented Sep 21, 2021

We may optimize the if statements that have constant expression as condition.
For example:

if true {
 <body>
}

may be replaced by:

<body>

while:

if false {
 <body>
}

may be skipped by the emitter.

@zapateo zapateo added improvement An optional improvement emitter/builder Related to VM's emitter and builder labels Sep 21, 2021
@gazerro gazerro changed the title compiler/emitter: optimize if statements with constant condition proposal: compiler/emitter: optimize if statements with constant condition Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter/builder Related to VM's emitter and builder improvement An optional improvement proposal Proposal-Accepted
Projects
None yet
Development

No branches or pull requests

2 participants