This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Arm] Convert -fallow-half-arguments-and-returns to a target option. NFC
ClosedPublic

Authored by dmgreen on Sep 14 2022, 12:04 PM.

Details

Summary

This cc1 option -fallow-half-arguments-and-returns allows __fp16 to be passed by argument and returned, without giving an error. It is currently always enabled for Arm and AArch64, by forcing the option in the driver. This means any cc1 tests (especially those needing arm_neon.h) need to specify the option too, to prevent the error from being emitted.

This changes it to a target option instead, set to true for Arm and AArch64. This allows the option to be removed. Previously it was implied by -fnative_half_arguments_and_returns, which is set for certain languages like open_cl, renderscript and hlsl, so that option now too controls the errors. There were are few other non-arm uses of -fallow-half-arguments-and-returns but I believe they were unnecessary. The strictfp_builtins.c tests were converted from __fp16 to _Float16 to avoid the issues.

Diff Detail

Event Timeline

dmgreen created this revision.Sep 14 2022, 12:04 PM
dmgreen requested review of this revision.Sep 14 2022, 12:04 PM

Ping - any thoughts on removing this option. It helps simplify the tests.

This revision is now accepted and ready to land.Sep 28 2022, 10:59 AM
This revision was landed with ongoing or failed builds.Sep 29 2022, 3:00 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 3:00 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript