This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Honor -mfloat-abi for libcall calling convention
ClosedPublic

Authored by efriedma on Sep 26 2017, 4:27 PM.

Details

Summary

As far as I can tell, this matches gcc: -mfloat-abi determines the calling convention for all functions except those explicitly defined as soft-float in the ARM RTABI.

This change only affects cases where the user specifies -mfloat-abi to override the default calling convention derived from the target triple.

Fixes https://bugs.llvm.org//show_bug.cgi?id=34530.

(This obsoletes https://reviews.llvm.org/D38050 if it's accepted.)

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Sep 26 2017, 4:27 PM
peter.smith edited edge metadata.Sep 27 2017, 10:40 AM

I'm happy with this change; it matches my understanding of what gcc does as well. I think that in practice it is the users responsibility to match the compiler-rt or libgcc with their choice of mfloat-abi.

test/CodeGen/Thumb2/intrinsics-cc.ll
12 ↗(On Diff #116737)

Can we remove the CHECK-TO-SOFT and CHECK-TO-HARD --check-prefix as it doesn't look like we have any instances of these any more?

efriedma updated this revision to Diff 116878.Sep 27 2017, 2:04 PM

Fix CHECK lines.

I think the change is the right thing to do, I was hoping to see if there were any objections/feedback from anyone that commented more strongly on D38050. If there aren't any more comments by next week I can approve.

compnerd accepted this revision.Oct 22 2017, 5:44 PM
compnerd added inline comments.
lib/Target/ARM/ARMISelLowering.cpp
234 ↗(On Diff #116878)

@peter.smith and I had a look at this. Since at least GCC 4.9, GCC uses the floating point ABI to determine the libcall calling convention. Note that this does break the current ABI.

Given that GCC now does something sane (i.e. only the __aeabi_ functions are soft float, and the other calls are dependent on -mfloat-abi) this seems like the best thing to do.

This revision is now accepted and ready to land.Oct 22 2017, 5:44 PM
This revision was automatically updated to reflect the committed changes.