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

Idea: Keep track of set condition codes #401

Closed
eira-fransham opened this issue Feb 11, 2019 · 1 comment
Closed

Idea: Keep track of set condition codes #401

eira-fransham opened this issue Feb 11, 2019 · 1 comment
Labels
lightbeam Issues related to the Lightbeam compiler

Comments

@eira-fransham
Copy link
Contributor

If we kept track of what conditions were set we could get better performance on the idiom:

for (int i = something; i != 0; i--) {
  // ...
}

Instead of emitting a cmp after the dec, we can work out that we already have the zero flag set from the dec and just emit a jnz. Currently there's no way to abstract over different instructions and get metadata for them, so this would be very complicated to implement without a new assembler.

EDIT: Keeping track of what instructions mutate which condition codes would allow us to implement CraneStation/lightbeam#16 in a way that only spills the "condition" if we're about to emit an instruction that would invalidate it.

@sunfishcode sunfishcode transferred this issue from CraneStation/lightbeam Oct 5, 2019
@sunfishcode sunfishcode added the lightbeam Issues related to the Lightbeam compiler label Oct 5, 2019
@alexcrichton
Copy link
Member

Lightbeam was removed in #3390 as explained in RFC 14, so I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lightbeam Issues related to the Lightbeam compiler
Projects
None yet
Development

No branches or pull requests

3 participants