[LLVMdev] llvm register reload/spilling around calls

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Oct 19 14:21:18 PDT 2010


On Oct 19, 2010, at 11:40 AM, Roland Scheidegger wrote:

> So I saw that the code is doing lots of register spilling/reloading. Now
> I understand that due to calling conventions, there's not really a way
> to avoid this - I tried using coldcc but apparently the backend doesn't
> implement it and hence this is ignored.

Yes, unfortunately the list of call-clobbered registers is fixed at the moment, so coldcc is mostly ignored by the backend.

Patches welcome.

> So is there any optimization option I'm missing which could improve
> this? Or is this simply the way things are (would that be considered a
> bug?). If this is a known limitation, any ideas if it's possible to work
> around that (by changing the affected jit code)?

The -pre-alloc-split option should handle stuff like this when calls clobber an entire register class. That probably only applies to XMM registers.

Work on proper live range splitting is in progress. You can try it out with -spiller=inline, but it is highly experimental and volatile at the moment.

I don't know any short term solutions.

/jakob





More information about the llvm-dev mailing list