-
Notifications
You must be signed in to change notification settings - Fork 5
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
Local state is not safe #6
Comments
I have a better solution, we can rewrite I have been able to make it work, but I have to clean up my code a bit. Expect a pull request soon. Update: the change significantly affects some benchmarks, so I am investigating further. But maybe the microbenchmarks are also not representative of real-world scenarios w.r.t. inlining and specialization as Alexis King's talk "Effects for Less" showed. |
@noughtmare I tried to reproduce this with the current HEAD and it works as intended. Can your confirm that? |
If I compile with optimizations then I can still reproduce it. |
E.g. the program:
Prints (when compiled with
-O
):I think that this is due to common sub-expression elimination. First the code above gets turned into something like:
And common sub-expression elimination transforms that to:
A simple solution seems to be to mark
perform
NOINLINE
, but that probably affects performance.The text was updated successfully, but these errors were encountered: