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

Peephole optimization for double load to registers #1153

Open
jackdotink opened this issue Jan 22, 2024 · 0 comments
Open

Peephole optimization for double load to registers #1153

jackdotink opened this issue Jan 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jackdotink
Copy link

For the following code in O2 mode, Luau creates this bytecode:

local v
v = 10
LOADNIL R0
LOADN R0 10

Here Luau is assigning to the same register twice in a row. It's possible that Luau can remove this in an optimization pass to keep only the latter load. My own personal motivation for this is zap, which uses the above syntax extensively, and it wouldn't be trivial to change that.

@jackdotink jackdotink added the enhancement New feature or request label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant