This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping: patch to remove the old RA


Vladimir Makarov wrote:

IRA has better communication with reload. Reload can assign hard register to pseudo spilled by reload and by *IRA*. IRA can advice reload to spill better pseudo and can say to share stack slots for pseudo and advice to do some other small optimizations. But even this code in reload is not so big (about 50 lines).


It would be nice to remove reload. I think it is possible but it is a bigger project than IRA.

I've been pondering what a world without reload, or at least one with a drastically different reload would look like. And to be honest I'm not getting too far.

One approach that has been tried with some initial success was to have, effectively, a pre-reload pass which IIRC ran before register allocation. However, it was also my understanding that this pass basically just moved when big hunks of reload
ran rather than actually eliminating the need for the spaghetti code known as reload. I'm certainly not opposed to a pre-reload pass, but I'd rather it be new, clean, code.


There was talk of doing instruction selection prior to allocation at the summit a few years back. I never knew what happened to that idea. It's never been absolutely clear to me how this would work given in our register class based world, but if someone could walk me through how it was supposed to work/help it would be greatly appreciated.

There was another initiative which attacked the horrid reload inheritance code and replaced it with a basic dependency graph. Ideally I'd like a reload pass which didn't need any of the reload inheritance stuff. Reload inheritance and the other optimizers are just making the problem that reload generates horrid code once we start spilling. If we're going to have reload inheritance, I'd certainly want a real dependency graph rather than the "time" stuff we do now.


Some have stated that they want to see reload go away. While I'd like that too, I'll state again that I'd be happy with a vastly simpler reload, preferably one that doesn't reload too often for common cases and as a result we don't have to work so damn hard to optimize the code it creates.


I suspect the first thing we need to do is get a reasonable idea of what triggers reloads these days:

Are we typically dealing with constraint mismatches within register classes?

Is it due to operands living in memory and needing to be moved into registers?

Is it secondary reloads because of out of range addresses?

Secondary memory?


etc etc




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]