[PATCH] D92487: [AArch64][Driver][SVE] Push missing SVE feature error from driver to frontend

Peter Waller via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 07:58:32 PST 2020


peterwaller-arm created this revision.
Herald added subscribers: cfe-commits, psnobl, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: clang.
peterwaller-arm requested review of this revision.

... 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.

2. Feature implication is well modelled in LLVM, so push the error down the stack.

3. 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' feature flag; 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92487

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/Driver/aarch64-sve-vector-bits.c
  clang/test/Sema/arm-vector-types-support.c
  clang/test/Sema/neon-vector-types-support.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92487.308971.patch
Type: text/x-patch
Size: 6091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201202/3d448b92/attachment-0001.bin>


More information about the cfe-commits mailing list