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

All values are written back to memory even when they're unused #3

Open
davidgiven opened this issue Mar 3, 2018 · 2 comments
Open

Comments

@davidgiven
Copy link
Owner

There's no way to mark a variable as being killed, i.e. that the value will never be read from again; this means the code generator always has to write them back to memory when the register gets flushed even if it's a waste.

The easy fix (of adding a KILL iop for doing this) is problematic because some iops flush all registers --- consider BEQ.

But annotating the iops themselves is hard because temporaries only get freed after the iop is emitted.

@davidgiven
Copy link
Owner Author

This is partially implemented; KILL iops are ignored for comparisons and branches. It's had a small effect on code size only, which was a bit disappointing.

@shattered
Copy link
Contributor

I think BEQ and others can avoid full cache flush if comparison insn itself is non-destructive; I've experimental code that uses low bit of label ID to mark label as 'safe' to branch to without flush.

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

No branches or pull requests

2 participants