Do I need to implement CCAssignFnForCall for porting GlobalISel to AVR target?

Hi Leslie,

Long story short - no, you don't need CCAssignFnForCall.

In fact, if you look at the X86CallLowering, you'll see that it
doesn't use that either, since it can use CC_X86 directly. For ARM it
made sense to have a CCAssignFnForCall so we could reuse the code in
ARMISelLowering.

I don't know the AVR backend very well, so I can't help you figure out
what is most appropriate for the AVR target. Having a CCAssignFn
available would make it easier to use the existing infrastructure, but
in principle you should be able to get away without one if you
override ValueHandler::assignArg. After a cursory look at
AVRISelLowering, I see it has some custom code for analyzing arguments
- you'll probably have to somehow incorporate that logic into
assignArg.

Hope that helps,
Diana

Hi Diana,

Thanks for your kind response!

Yes, ARM target is more complex than AVR to getEffectiveCallingConv ID https://github.com/llvm-mirror/llvm/blob/master/lib/Target/ARM/ARMISelLowering.cpp#L1559 I need to read ARM's code carefully.