method prologue code generation
Vasanth.Venkatachalam at amd.com
Wed Apr 10 08:33:38 PDT 2013
I'm looking at PTXBackend.emitCode( ) and it looks like the code for the method prologue is being emitted before the actual code generation takes place in the call to lirGen.lir.emitCode(tasm). In particular, it looks like the registers that are later used in the code generation of the method body are being manually declared here.
Can someone explain the intent for doing things in this order?
My concern is the following. It looks like the mapping of method parameters/variables to registers only happens in the call to lirGen.lir.emitCode( ), so before this call takes place it seems you wouldn't really know which registers will be used for different parameters/variables.
So how would you know what registers need to be declared in the prologue section, before you generate the code for the body of the method?
On the other hand, do you have a way of piping the variable->register mapping information from lirGen.lir.emitCode( ) so that you can retrieve this when you generate the prologue?
More information about the graal-dev