ARM procedure calls


I’m looking to allow LLVM to simplify more library calls and it appears that currently this cannot happen for functions that are declared with a call standard other than C. Specifically I’m trying to work around function calls annotated with ‘aapcs_vfpcc’.

I see that the VFP standard is used when -mfloat-abi=hard is provided, but it is not used when arm-none-eabihf is used as a triple. It looks like this happens because Clang decides that the ARM backend will be capable of figuring out what standard to use and so doesn’t worry about using extra annotations. But the backend is also capable of querying the Float ABI too, so I assume it would be capable of calculating the standard in either case. I want to make a simple change to Clang like this:

/// Return the default calling convention that LLVM will use.
llvm::CallingConv::ID ARMABIInfo::getLLVMDefaultCC() const {
// The default calling convention that LLVM will infer.
if (isEABIHF() || getTarget().getTriple().isWatchABI() ||

  • Kind == ARMABIInfo::AAPCS_VFP)

return llvm::CallingConv::ARM_AAPCS_VFP;

But this change makes the CodeGen tests, that are testing the declared aapcs, fail. So my question is, (1) why is does the behaviour differ between -mfloat=hard and eabihf targets and (2) what would definitely break if clang didn’t annotate some functions with aapcs_vfp?


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.