>>>
>>> And then, afterwards, once code has been generated for the whole 'block',
>>> the register-allocator fills in the registers. And store/restores them when
>>> needed. This can be done using an algorithm that uses a tree to 'peel-down'
>>> (is this English?) all the solutions. Just like is done with a
>>> regular-expression parser.
>>>
>>> Just dreaming. I don't have the time to work on it, and I don't even know
>>> how it works at the moment. But that would seem to be the ideal solution to
>>> me.
>> But this is how it is basically currently done?
>
> But why do you need to redo the code generation? At the moment the real
> registers are assigned, you do know if you need the y register for some
> specific task, no?
Well, thinking about it, maybe yes with some hacky approach. The issue is: only
after register allocation it is known if temps. for spilling are needed. If any
local data is used (local vars, temps, temps for spilling etc) then a frame
pointer is needed, and if spilling temps are needed is only known when register
allocation is complete.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal