2 ms·
So for what I can tell, there are two issues: - one less register means more spills, so more instructions and more read/writes from the stack. - when frame po
by gpderetta 4y ago
So for what I can tell, there are two issues:
- one less register means more spills, so more instructions and more read/writes from the stack.
- when frame pointer is enabled, gcc uses offsets from the framepointer to address stack slots instead of offsets from the stack pointer. For the python interpreter function this means larger offsets, but it is not always necessarily the case. The right thing would be for the compiler to always issue the shorter instruction (i.e. an offset from rbp or rsp).
edit: rbp offsets are normally negative, so yes, they are usually larger than positive rsp offsets.
- moloch-hai 4y agoOf course you don't need to devote a register, so no spills. Using the frame pointer for access to local stack spills is a pessimization the compiler should stop doing, regardless of the build mode.