On Mon, Jul 7, 2014 at 1:47 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Jul 07, 2014 at 03:35:06PM +0400, Evgeny Stupachenko wrote: >> The key problem here is that EBX is not used in register allocation. >> If we relax the restriction on EBX the performance is back, but there >> are several fails. >> Some of them could be fixed. >> However I don't like that way as EBX register is uninitialized at >> register allocation. > > That is nothing wrong. The magic registers are to be assumed live from the > beginning until the prologue is emitted. > >> Initialization (SET_GOT) appeared only at: "217r.pro_and_epilogue" phase. >> >> The key point in 2 suggestions is to set EBX register only prior to a >> call (as it is required by ABI). In all other cases it could be any >> other register. > > You could use special call insn patterns for calls that need to have ebx > set, where there would be a > (use (match_operand:SI NN "register_operand" "b")) > and pass in the lgot pseudo and leave the register allocator to do its job. > You'd need to remember in which hard register (or memory) the register > allocator wants lgot to be at the start of the first basic block (so that > when prologue is expanded you know where to store it).
You can probably use get_hard_reg_initial_val for this. Uros.