[cfe-dev] ARM procedure calls (sorry)

Sam Parker via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 18 08:23:52 PDT 2016

Hi again,

I forgot to remove the 'important notice' stuff from the footer of my last email, so I am sorry.

Here's my previous question:

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?


Sam Parker

Software Engineer, Compilation Tools

Development Solutions Group
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160818/f2765b07/attachment.html>

More information about the cfe-dev mailing list