[all-commits] [llvm/llvm-project] 263965: [AArch64] Add a check for invalid default features...

Tomas Matheson via All-commits all-commits at lists.llvm.org
Tue Aug 20 00:19:53 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 263965ebe237e2f82d714a12a8c9338b46237a33
      https://github.com/llvm/llvm-project/commit/263965ebe237e2f82d714a12a8c9338b46237a33
  Author: Tomas Matheson <Tomas.Matheson at arm.com>
  Date:   2024-08-20 (Tue, 20 Aug 2024)

  Changed paths:
    M clang/test/CodeGen/aarch64-targetattr.c
    A clang/test/Driver/aarch64-negative-modifiers-for-default-features.c
    M clang/test/Driver/arm-sb.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a12.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a13.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a14.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a15.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a16.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-a17.c
    M clang/test/Driver/print-enabled-extensions/aarch64-apple-m4.c
    M clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82.c
    M clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82ae.c
    M llvm/lib/Target/AArch64/AArch64Features.td
    M llvm/lib/Target/AArch64/AArch64Processors.td
    M llvm/test/MC/AArch64/arm64-system-encoding.s
    M llvm/test/MC/AArch64/armv8.5a-ssbs-error.s
    M llvm/test/MC/AArch64/armv8.5a-ssbs.s
    M llvm/test/MC/Disassembler/AArch64/armv8.5a-ssbs.txt
    M llvm/test/MC/Disassembler/AArch64/basic-a64-instructions.txt
    M llvm/unittests/TargetParser/TargetParserTest.cpp
    M llvm/utils/TableGen/ARMTargetDefEmitter.cpp

  Log Message:
  -----------
  [AArch64] Add a check for invalid default features (#104435)

This adds a check that all ExtensionWithMArch which are marked as
implied features for an architecture are also present in the list of
default features. It doesn't make sense to have something mandatory but
not on by default.

There were a number of existing cases that violated this rule, and some
changes to which features are mandatory (indicated by the Implies
field).

This resulted in a bug where if a feature was marked as `Implies` but
was not added to `DefaultExt`, then for `-march=base_arch+nofeat` the
Driver would consider `feat` to have never been added and therefore
would do nothing to disable it (no `-target-feature -feat` would be
added, but the backend would enable the feature by default because of
`Implies`). See
clang/test/Driver/aarch64-negative-modifiers-for-default-features.c.

Note that the processor definitions do not respect the architecture
DefaultExts. These apply only when specifying `-march=<some architecture
version>`. So when a feature is moved from `Implies` to `DefaultExts` on
the Architecture definition, the feature needs to be added to all
processor definitions (that are based on that architecture) in order to
preserve the existing behaviour. I have checked the TRMs for many cases
(see specific commit messages) but in other cases I have just kept the
current behaviour and not tried to fix it.



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