You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As ShivyC compiles this today, the output code is about 25% slower than GCC on my machine for i = 9. ShivyC allocates i on the stack, not in a register, because it must survive a call to the fib function. GCC, on the other hand, places i into the EBX register which is not currently possible in ShivyC because ShivyC does not support callee-saved registers. When adding a range split manually, as follows, ShivyC output performance is roughly comparable to GCC:
I noticed that the following function benefits from live range splitting:
As ShivyC compiles this today, the output code is about 25% slower than GCC on my machine for
i = 9
. ShivyC allocatesi
on the stack, not in a register, because it must survive a call to thefib
function. GCC, on the other hand, placesi
into the EBX register which is not currently possible in ShivyC because ShivyC does not support callee-saved registers. When adding a range split manually, as follows, ShivyC output performance is roughly comparable to GCC:Here, ShivyC keeps
i
in the edi register, and allocates onlyi2
on the stack, which improves performance significantly on the comparisons.The paper Live Range Splitting in a Graph Coloring Register Allocator (link) looks very relevant.
The text was updated successfully, but these errors were encountered: