3 ms·
I wonder how significantly frame pointers damages the stack engine optimization in x86 processors. There's still a bunch of pushes and pops, I guess because th
by throwawaylinux 4y ago
I wonder how significantly frame pointers damages the stack engine optimization in x86 processors.
There's still a bunch of pushes and pops, I guess because that's shorter code than storing into an explicit offset off the stack pointer, but since you've read the stack pointer anyway and synchronized it, the uop sequence and instruction dependencies wouldn't end up being a lot different I would have thought.
- rwmj 4y agoIt does damage it actually. GCC currently generates slightly pessimised code when frame pointers are enabled, for example always using the frame pointer to access stack variables even if it knows the offset from the stack pointer. I guess this is simply because distributions were all using -fomit-frame-pointer so the frame pointer case was neglected. Hopefully this will improve now that most distros have switched to enabling frame pointers.