-
Notifications
You must be signed in to change notification settings - Fork 11
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
Constant folding does not work when variable is used in multiple vectors #33
Comments
Indeed it doesn't. Just another proof of how the DCR module sucks. I never got to spending the effort to replace it with something that doesn't suck so much. The whole optimizer will become obsolete once the new Luau engine is the default, so I don't think this is worth fixing. |
That is still some unknown time away. Also, since LSL running on Luau engine will be a thing for quite a while and depending on how good the Luau compiler is at constant folding, dead code removal, constant string concatenation, parts of the optimizer might still be quite a useful to use in combination with the preprocessor. For example: Also, there's likely to be new LSL functions before Luau stuff shows up, like Combat2 stuff that went live recently, some more notecard related stuff is coming soon too etc. That being said, the LSL Optimizer is great, don't write it all off just yet, I think it will still be plenty useful until we get native Luau scripts. |
Thanks for your opinion. I'm not going to redesign the DCR module at this point, which is needed to fix this, especially given that the main blocker for that redesign is that it has the potential to produce larger code instead of shorter, due to Mono save/restore code injection, an issue which would automatically be solved with Luau. True, no matter how well Luau optimizes, I seriously doubt it will apply function semantics to the optimizations (e.g. it won't resolve As a side comment, |
It will be open source, from SUG meeting a while back:
Edit: I guess that doesn't specify if it is for native Luau or for LSL on Luau... |
In the following code:
touch_start does not fully fold the constants:
Options used: Constant Folding and Dead Code Removal. (In the online version of the optimizer)
Expected: both vec1 and vec2 should resolve to <2., 0., 0.>
The text was updated successfully, but these errors were encountered: