[all-commits] [llvm/llvm-project] ad702e: [AArch64] Extend SVE diagnostics. (#94976)

Harald van Dijk via All-commits all-commits at lists.llvm.org
Fri Jun 14 04:56:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad702e057cf7fc1ffdc0f78f563b416170ea7d57
      https://github.com/llvm/llvm-project/commit/ad702e057cf7fc1ffdc0f78f563b416170ea7d57
  Author: Harald van Dijk <harald.vandijk at codeplay.com>
  Date:   2024-06-14 (Fri, 14 Jun 2024)

  Changed paths:
    M clang/lib/Sema/Sema.cpp
    M clang/test/CodeGen/aarch64-targetattr-arch.c
    M clang/test/CodeGen/aarch64_neon_sve_bridge_intrinsics/target.c
    M clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
    M clang/test/Sema/aarch64-sme2-sve2p1-diagnostics.c
    M clang/test/Sema/arm-sve-target.cpp

  Log Message:
  -----------
  [AArch64] Extend SVE diagnostics. (#94976)

The SVE diagnostics were guarded by a FD->hasBody() check that prevented
the diagnostic from being emitted for code that still triggered the
backend crashes that the errors were meant to avoid, because
FD->hasBody() returns false for a function that Clang is currently
processing. This is not done for the equivalent RISC-V code, and is not
needed for AArch64 either, so remove it.

Errors were also emitted in the wrong location, errors were emitted at
the called function's location, rather than at the caller's, which meant
that just removing the FD->hasBody() check resulted in incomprehensible
errors. Change this as well.

The aarch64-mangle-sve-vectors.cpp test was using -target-feature wrong
which was exposed as a result of these changes. Different target
features need to be passed in as different -target-feature options.

aarch64-targetattr-arch.c has a test_errors() function that needs to be
split in two. Now that svundef_s8() is diagnosed for its use of
svint8_t, the "needs target feature sve" diagnostic is no longer
emitted, but this affects all calls in the same function. To ensure we
still check this for its __crc32cd call, move that into a separate
function.

Fixes #94766.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list