Borja Ferrer
2013-Jul-02 12:15 UTC
[LLVMdev] Problem selecting the correct registers for a calling convention
Hello Job,
I managed to resolve this same problem by using custom C++ code since as
you mentioned
the isSplit flag doesn't help here. There are 2 ways to analyze the
arguments of a function:
1) You can get a Function pointer in LowerFormalArguments, and in LowerCall
only when Callee can by dyn_casted to a GlobalAddressSDNode. By having this
pointer you can then do:
for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();I
!E; ++I)
{
unsigned Bytes = TD->getTypeSizeInBits(I->getType()) / 8;
// do stuff here
}
2) The second case is when the dyn_cast above fails because the Callee
SDValue is a
ExternalSymbolSDNode. In this case you have to manually analyze the
arguments using PartOffset.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20130702/719fc65c/attachment.html>
Job Noorman
2013-Jul-03 13:37 UTC
[LLVMdev] Problem selecting the correct registers for a calling convention
Hi Borja, Thanks a lot! Looking at your implementation in the AVR backend has helped me solve the problem for the MSP430. Regards, Job On Tuesday 02 July 2013 14:15:18 Borja Ferrer wrote:> Hello Job, > > I managed to resolve this same problem by using custom C++ code since as > you mentioned > the isSplit flag doesn't help here. There are 2 ways to analyze the > arguments of a function: > > 1) You can get a Function pointer in LowerFormalArguments, and in LowerCall > only when Callee can by dyn_casted to a GlobalAddressSDNode. By having this > pointer you can then do: > > for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();I !> E; ++I) > > { > unsigned Bytes = TD->getTypeSizeInBits(I->getType()) / 8; > // do stuff here > } > > > 2) The second case is when the dyn_cast above fails because the Callee > SDValue is a > > ExternalSymbolSDNode. In this case you have to manually analyze the > arguments using PartOffset.
Apparently Analagous Threads
- [LLVMdev] Problem selecting the correct registers for a calling convention
- [LLVMdev] Problem selecting the correct registers for a calling convention
- [LLVMdev] LowerCALL (TargetLowering)
- [LLVMdev] LowerCALL (TargetLowering)
- [LLVMdev] Callee prototype info in LowerCall()