-
Notifications
You must be signed in to change notification settings - Fork 30
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 Variables #584
Local Variables #584
Conversation
%stackPointerPointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 0 | ||
%basePointer = getelementptr %StackValue, %Stack %stack, i64 0, i32 1, i32 1 | ||
|
||
%stackPointer = load %StackPointer, ptr %stackPointerPointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, we now try to use the convention Foo_pointer
. So this will be stackPointer_pointer
Great job! Do you have results on running benchmarks on this? |
I ran benchmarks and this seems to be slower in most cases. |
Thanks for running the benchmarks. Your analysis makes perfect sense! I think there are several things that we could do:
What "normal" people do is to push a stackframe for every function. The stackframe has a "shape" and we thus know how many locals there will be at most (that means, we only have one eraser / sharer per frame-shape). Now in our LLVM backend we do not push every function frame, but only a) lead to longer lifetimes for some mutable variables |
Could you rebase onto current master? I can not reproduce the bad benchmarks, we should discuss offline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Let's keep the optimizations discussed above in mind, but ignore them for now. |
Allocate local variables directly on the stack, with a special stack frame