[cfe-dev] ARM procedure calls (sorry)

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Sat Aug 20 07:50:46 PDT 2016

On 18 August 2016 at 16:23, Sam Parker via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> (1) why is does the behaviour differ between -mfloat=hard and eabihf targets

Hi Sam,

This looks like an oversight. It should mark functions as vfp on eabihf.

I haven't seen that triple been used yet, so maybe that's the reason
why it's not recognised.

We don't do "if Env.endsWith("hf") HardFloat = true;" as that could
have false-positives, so we do one at a time.

> (2) what would definitely break if clang didn't annotate some functions with aapcs_vfp?

Many assumptions would break down. The vfp flag was created because it
is possible to have IR with more than one PCS (attributes, merged
modules, etc), so each function has independent behaviour.

Also, front-ends can, for whatever reason, create separate pools of
soft-float and hard-float functions, if it can guarantee they're
disjoint. For example, if user code is allowed to have hard-float but
library code is not, so you create thunks to convert the calling
convention back and forth, as a way to migrate separate parts of your

If we remove the attribute from the function, we'd go back relying on
the triple, which is not just unreliable, but can't convey all the
information that we need in object files.

I think the real question is: why is your pass only valid in the C
calling convention?


More information about the cfe-dev mailing list