On 07/07/14 04:42, Richard Biener wrote:
1.

While call expand emit SET_GOT -> EBX and MOV EBX -> some local register: LGOT
Prior to each call emit MOV LGOT -> EBX
Use LGOT as new GOT register for globals.

2.

Set EBX as each CALL parameter.
Emit MOV EBX->LGOT in each call.
Use LGOT as new GOT register for globals.

Do you have any comments, ideas?
IIRC we did this for a while on the PA. Basically the call expanders would set the hard PIC register from a pseudo holding the right value. We let the register allocator (of course) do the job of allocating the pseudo.

In rare circumstances the allocator could allocate the pseudo to the hard PIC register, that was very rare because the hard PIC register was call-clobbered.


Use some LCM algorithm for placing %ebx loads, similar to
how we treat vzeroupper?
Shouldn't be too hard to do this. I suspect most of the benefit is from being able to use %ebx when it's not being used for the PIC register. But it probably wouldn't hurt to optimize placements.


Compute some simple IPA info on whether %ebx is provided/needed
by callers/callees?
Yea. Knowing if the caller/callee have the same value may also be helpful.

jeff

Reply via email to