[LLVMdev] llvm register reload/spilling around calls

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Oct 20 12:15:26 PDT 2010


On Oct 20, 2010, at 11:53 AM, Dan Gohman wrote:

> 
> On Oct 19, 2010, at 8:00 PM, Jakob Stoklund Olesen wrote:
>> 
>> 
>> One problem is that calling conventions are handled while building the selection DAG, and the DAG doesn't really know to represent clobbered registers.
>> 
>> Perhaps X86TargetLowering::LowerCall() could decorate the X86ISD::CALL node with the calling convention somehow?
>> 
>> Dan, do you have any thoughts on how to communicate the calling convention and call clobbered registers to the eventual CALL MachineInstr?
> 
> The simplest way would probably be to add separate X86ISD opcodes for
> each desired set of call-clobbered registers.

The problem is the large number of call-like instructions.

We would need copies of CALL*, TCRETURN*, and TAILJMP* for each calling convention. I was hoping we could avoid that, and even get rid of the WINCALL instructions.

What if InstrEmitter::EmitMachineNode called a target hook to add call-clobbered registers when II.isCall()? We would need some way of communicating the calling convention to the target hook. An immediate operand could work.

/jakob





More information about the llvm-dev mailing list