[all-commits] [llvm/llvm-project] 9d7b4c: [AArch64] Remove unused fields from CPUs in Target...

tmatheson-arm via All-commits all-commits at lists.llvm.org
Thu Dec 1 04:51:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d7b4c207b50a0db1f25b6fd8fb68c779497d62f
      https://github.com/llvm/llvm-project/commit/9d7b4c207b50a0db1f25b6fd8fb68c779497d62f
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M llvm/include/llvm/Support/AArch64TargetParser.def
    M llvm/include/llvm/Support/AArch64TargetParser.h
    M llvm/lib/Support/AArch64TargetParser.cpp

  Log Message:
  -----------
  [AArch64] Remove unused fields from CPUs in TargetParser

Differential Revision: https://reviews.llvm.org/D138754


  Commit: f57f086714bc7a1399acf05d5ca1d665237cd725
      https://github.com/llvm/llvm-project/commit/f57f086714bc7a1399acf05d5ca1d665237cd725
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/lib/Driver/ToolChains/Arch/AArch64.cpp
    M llvm/include/llvm/Support/AArch64TargetParser.h
    M llvm/lib/Support/AArch64TargetParser.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/unittests/Support/TargetParserTest.cpp

  Log Message:
  -----------
  [AArch64TargetParser] getArchFeatures -> getArchFeature

Differential Revision: https://reviews.llvm.org/D138753


  Commit: 450de8008bb0ccb5dfc9dd69b6f5b434158772bd
      https://github.com/llvm/llvm-project/commit/450de8008bb0ccb5dfc9dd69b6f5b434158772bd
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/lib/Basic/Targets/AArch64.h
    M clang/lib/Driver/ToolChains/Arch/AArch64.cpp
    M llvm/include/llvm/Support/AArch64TargetParser.def
    M llvm/include/llvm/Support/AArch64TargetParser.h
    M llvm/include/llvm/Support/VersionTuple.h
    M llvm/lib/Support/AArch64TargetParser.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/unittests/Support/TargetParserTest.cpp

  Log Message:
  -----------
  [AArch64] Improve TargetParser API

The TargetParser depends heavily on a collection of macros and enums to tie
together information about architectures, CPUs and extensions. Over time this
has led to some pretty awkward API choices. For example, recently a custom
operator-- has been added to the enum, which effectively turns iteration into
a graph traversal and makes the ordering of the macro calls in the header
significant. More generally there is a lot of string <-> enum conversion
going on. I think this shows the extent to which the current data structures
are constraining us, and the need for a rethink.

Key changes:

 - Get rid of Arch enum, which is used to bind fields together. Instead of
   passing around ArchKind, use the named ArchInfo objects directly or via
   references.

 - The list of all known ArchInfo becomes an array of pointers.

 - ArchKind::operator-- is replaced with ArchInfo::implies(), which defines
   which architectures are predecessors to each other. This allows features
   from predecessor architectures to be added in a more intuitive way.

 - Free functions of the form f(ArchKind) are converted to ArchInfo::f(). Some
   functions become unnecessary and are deleted.

 - Version number and profile are added to the ArchInfo. This makes comparison
   of architectures easier and moves a couple of functions out of clang and
   into AArch64TargetParser.

 - clang::AArch64TargetInfo ArchInfo is initialised to Armv8a not INVALID.

 - AArch64::ArchProfile which is distinct from ARM::ArchProfile

 - Give things sensible names and add some comments.

Differential Revision: https://reviews.llvm.org/D138792


Compare: https://github.com/llvm/llvm-project/compare/4d98eb21965b...450de8008bb0


More information about the All-commits mailing list