This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][Driver][SVE] Push missing SVE feature error from driver to frontend
ClosedPublic

Authored by peterwaller-arm on Dec 2 2020, 7:58 AM.

Details

Summary

... and give more guidance to users.

If specifying -msve-vector-bits on a non-SVE target, clang would say:

error: '-msve-vector-bits' is not supported without SVE enabled
  1. The driver lacks logic for "implied features". This would result in this error being raised for -march=...+sve2, even though +sve2 implies +sve.
  1. Feature implication is well modelled in LLVM, so push the error down the stack.
  1. Hint to the user what flag they need to consider setting.

Now clang fails later, when the feature is used, saying:

aarch64-sve-vector-bits.c:42:41: error: 'arm_sve_vector_bits' attribute is not supported on targets missing 'sve'; specify an appropriate -march= or -mcpu=
typedef svint32_t noflag __attribute__((arm_sve_vector_bits(256)));

Move clang/test/Sema/{neon => arm}-vector-types-support.c and put tests for
this warning together in one place.

Diff Detail

Event Timeline

peterwaller-arm created this revision.Dec 2 2020, 7:58 AM
peterwaller-arm requested review of this revision.Dec 2 2020, 7:58 AM
sdesmalen accepted this revision.Dec 2 2020, 9:02 AM

Other than the nit, LGTM.

clang/lib/Sema/SemaType.cpp
7803

nit: s/ feature flag//
(otherwise, for this case it should be 'feature flags' and the case below would need 'the ' in front of it, to read nicely).

This revision is now accepted and ready to land.Dec 2 2020, 9:02 AM

Tweak message to address review comment.

peterwaller-arm marked an inline comment as done.Dec 2 2020, 9:11 AM
peterwaller-arm edited the summary of this revision. (Show Details)Dec 2 2020, 9:16 AM

Update patch for clang-format

This revision was landed with ongoing or failed builds.Dec 10 2020, 4:43 AM
This revision was automatically updated to reflect the committed changes.
clang/test/Driver/aarch64-sve-vector-bits.c