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. Dan
Jakob Stoklund Olesen
2010-Oct-20 19:15 UTC
[LLVMdev] llvm register reload/spilling around calls
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
Anton Korobeynikov
2010-Oct-20 19:33 UTC
[LLVMdev] llvm register reload/spilling around calls
> The simplest way would probably be to add separate X86ISD opcodes for > each desired set of call-clobbered registers.Sounds really gross... Maybe it will be better just to teach codegen to query single place for the set of call-clobbered registers? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Anton Korobeynikov
2010-Oct-20 19:41 UTC
[LLVMdev] llvm register reload/spilling around calls
> 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.+1 -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
This is something we want to do. But it turns out to be more complicated since it touches a lot of code. My guess is we'll implement this sometime during the first half of next year in part to implement cold_cc. Evan On Oct 20, 2010, at 12:33 PM, Anton Korobeynikov wrote:>> The simplest way would probably be to add separate X86ISD opcodes for >> each desired set of call-clobbered registers. > Sounds really gross... Maybe it will be better just to teach codegen > to query single place for the set of call-clobbered registers? > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] llvm register reload/spilling around calls
- [LLVMdev] llvm register reload/spilling around calls
- [LLVMdev] llvm register reload/spilling around calls
- [LLVMdev] llvm register reload/spilling around calls
- [LLVMdev] llvm register reload/spilling around calls