[all-commits] [llvm/llvm-project] f09cf3: [Support] Move TargetParsers to new component

Sam Elliott via All-commits all-commits at lists.llvm.org
Tue Dec 20 03:06:13 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f09cf34d00625e57dea5317a3ac0412c07292148
      https://github.com/llvm/llvm-project/commit/f09cf34d00625e57dea5317a3ac0412c07292148
  Author: Archibald Elliott <archibald.elliott at arm.com>
  Date:   2022-12-20 (Tue, 20 Dec 2022)

  Changed paths:
    M bolt/lib/Core/CMakeLists.txt
    M bolt/lib/Passes/CMakeLists.txt
    M bolt/lib/Rewrite/CMakeLists.txt
    M clang-tools-extra/clang-tidy/portability/CMakeLists.txt
    M clang-tools-extra/clangd/CMakeLists.txt
    M clang-tools-extra/modularize/CMakeLists.txt
    M clang/docs/tools/clang-formatted-files.txt
    M clang/lib/ARCMigrate/CMakeLists.txt
    M clang/lib/AST/CMakeLists.txt
    M clang/lib/Basic/CMakeLists.txt
    M clang/lib/CodeGen/CMakeLists.txt
    M clang/lib/CrossTU/CMakeLists.txt
    M clang/lib/Driver/CMakeLists.txt
    M clang/lib/ExtractAPI/CMakeLists.txt
    M clang/lib/Frontend/CMakeLists.txt
    M clang/lib/Interpreter/CMakeLists.txt
    M clang/lib/Lex/CMakeLists.txt
    M clang/lib/Parse/CMakeLists.txt
    M clang/lib/Sema/CMakeLists.txt
    M clang/lib/Serialization/CMakeLists.txt
    M clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
    M clang/lib/Tooling/CMakeLists.txt
    M clang/lib/Tooling/DependencyScanning/CMakeLists.txt
    M clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
    M clang/tools/clang-import-test/CMakeLists.txt
    M clang/tools/clang-linker-wrapper/CMakeLists.txt
    M clang/tools/clang-offload-bundler/CMakeLists.txt
    M clang/tools/driver/CMakeLists.txt
    M clang/tools/libclang/CMakeLists.txt
    M clang/unittests/AST/CMakeLists.txt
    M clang/unittests/ASTMatchers/CMakeLists.txt
    M clang/unittests/CodeGen/CMakeLists.txt
    M clang/unittests/Driver/CMakeLists.txt
    M clang/unittests/Frontend/CMakeLists.txt
    M clang/unittests/Interpreter/CMakeLists.txt
    M clang/unittests/Tooling/CMakeLists.txt
    M flang/lib/Frontend/CMakeLists.txt
    M flang/lib/Optimizer/CodeGen/CMakeLists.txt
    M flang/lib/Optimizer/Support/CMakeLists.txt
    M flang/tools/bbc/CMakeLists.txt
    M flang/tools/flang-driver/CMakeLists.txt
    M flang/unittests/Frontend/CMakeLists.txt
    M flang/unittests/Optimizer/CMakeLists.txt
    M libc/benchmarks/CMakeLists.txt
    M lld/COFF/CMakeLists.txt
    M lld/Common/CMakeLists.txt
    M lld/ELF/CMakeLists.txt
    M lld/MachO/CMakeLists.txt
    M lld/MinGW/CMakeLists.txt
    M lld/tools/lld/CMakeLists.txt
    M lld/wasm/CMakeLists.txt
    M lldb/source/Core/CMakeLists.txt
    M lldb/source/Host/macosx/objcxx/CMakeLists.txt
    M lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
    M lldb/source/Plugins/ABI/ARC/CMakeLists.txt
    M lldb/source/Plugins/ABI/ARM/CMakeLists.txt
    M lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt
    M lldb/source/Plugins/ABI/Mips/CMakeLists.txt
    M lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
    M lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt
    M lldb/source/Plugins/ABI/X86/CMakeLists.txt
    M lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
    M lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt
    M lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
    M lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
    M lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt
    M lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
    M lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt
    M lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
    M lldb/source/Plugins/Process/Linux/CMakeLists.txt
    M lldb/source/Plugins/Process/Utility/CMakeLists.txt
    M lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
    M lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
    M lldb/source/Utility/CMakeLists.txt
    M lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s
    M lldb/tools/intel-features/intel-mpx/CMakeLists.txt
    M lldb/unittests/Host/CMakeLists.txt
    M lldb/unittests/Utility/CMakeLists.txt
    M lldb/utils/lit-cpuid/CMakeLists.txt
    M llvm/examples/Kaleidoscope/Chapter9/CMakeLists.txt
    M llvm/include/llvm/ADT/Triple.h
    R llvm/include/llvm/Support/AArch64TargetParser.def
    M llvm/include/llvm/Support/AArch64TargetParser.h
    R llvm/include/llvm/Support/ARMTargetParser.def
    M llvm/include/llvm/Support/ARMTargetParser.h
    M llvm/include/llvm/Support/ARMTargetParserCommon.h
    R llvm/include/llvm/Support/CSKYTargetParser.def
    M llvm/include/llvm/Support/CSKYTargetParser.h
    M llvm/include/llvm/Support/Host.h
    R llvm/include/llvm/Support/LoongArchTargetParser.def
    M llvm/include/llvm/Support/LoongArchTargetParser.h
    M llvm/include/llvm/Support/RISCVISAInfo.h
    R llvm/include/llvm/Support/RISCVTargetParser.def
    M llvm/include/llvm/Support/TargetParser.h
    M llvm/include/llvm/Support/X86TargetParser.def
    M llvm/include/llvm/Support/X86TargetParser.h
    A llvm/include/llvm/TargetParser/AArch64TargetParser.def
    A llvm/include/llvm/TargetParser/AArch64TargetParser.h
    A llvm/include/llvm/TargetParser/ARMTargetParser.def
    A llvm/include/llvm/TargetParser/ARMTargetParser.h
    A llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
    A llvm/include/llvm/TargetParser/CSKYTargetParser.def
    A llvm/include/llvm/TargetParser/CSKYTargetParser.h
    A llvm/include/llvm/TargetParser/Host.h
    A llvm/include/llvm/TargetParser/LoongArchTargetParser.def
    A llvm/include/llvm/TargetParser/LoongArchTargetParser.h
    A llvm/include/llvm/TargetParser/RISCVISAInfo.h
    A llvm/include/llvm/TargetParser/RISCVTargetParser.def
    A llvm/include/llvm/TargetParser/TargetParser.h
    A llvm/include/llvm/TargetParser/Triple.h
    A llvm/include/llvm/TargetParser/X86TargetParser.def
    A llvm/include/llvm/TargetParser/X86TargetParser.h
    M llvm/lib/Analysis/CMakeLists.txt
    M llvm/lib/BinaryFormat/CMakeLists.txt
    M llvm/lib/Bitcode/Reader/CMakeLists.txt
    M llvm/lib/Bitcode/Writer/CMakeLists.txt
    M llvm/lib/CMakeLists.txt
    M llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
    M llvm/lib/CodeGen/CMakeLists.txt
    M llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
    M llvm/lib/DWARFLinker/CMakeLists.txt
    M llvm/lib/DebugInfo/DWARF/CMakeLists.txt
    M llvm/lib/DebugInfo/GSYM/CMakeLists.txt
    M llvm/lib/DebugInfo/LogicalView/CMakeLists.txt
    M llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
    M llvm/lib/ExecutionEngine/CMakeLists.txt
    M llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
    M llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
    M llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
    M llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
    M llvm/lib/Frontend/OpenMP/CMakeLists.txt
    M llvm/lib/FuzzMutate/CMakeLists.txt
    M llvm/lib/IR/CMakeLists.txt
    M llvm/lib/InterfaceStub/CMakeLists.txt
    M llvm/lib/LTO/CMakeLists.txt
    M llvm/lib/Linker/CMakeLists.txt
    M llvm/lib/MC/CMakeLists.txt
    M llvm/lib/MC/MCDisassembler/CMakeLists.txt
    M llvm/lib/MC/MCParser/CMakeLists.txt
    M llvm/lib/Object/CMakeLists.txt
    M llvm/lib/ObjectYAML/CMakeLists.txt
    M llvm/lib/ProfileData/CMakeLists.txt
    M llvm/lib/ProfileData/Coverage/CMakeLists.txt
    R llvm/lib/Support/AArch64TargetParser.cpp
    R llvm/lib/Support/ARMTargetParser.cpp
    R llvm/lib/Support/ARMTargetParserCommon.cpp
    M llvm/lib/Support/CMakeLists.txt
    R llvm/lib/Support/CSKYTargetParser.cpp
    R llvm/lib/Support/Host.cpp
    R llvm/lib/Support/LoongArchTargetParser.cpp
    R llvm/lib/Support/RISCVISAInfo.cpp
    R llvm/lib/Support/TargetParser.cpp
    R llvm/lib/Support/Triple.cpp
    R llvm/lib/Support/Unix/Host.inc
    R llvm/lib/Support/Windows/Host.inc
    R llvm/lib/Support/X86TargetParser.cpp
    M llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt
    M llvm/lib/Target/AArch64/CMakeLists.txt
    M llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
    M llvm/lib/Target/ARM/AsmParser/CMakeLists.txt
    M llvm/lib/Target/ARM/CMakeLists.txt
    M llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/BPF/CMakeLists.txt
    M llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/CMakeLists.txt
    M llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt
    M llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/DirectX/CMakeLists.txt
    M llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt
    M llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt
    M llvm/lib/Target/Hexagon/CMakeLists.txt
    M llvm/lib/Target/Lanai/CMakeLists.txt
    M llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/Mips/AsmParser/CMakeLists.txt
    M llvm/lib/Target/Mips/CMakeLists.txt
    M llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/NVPTX/CMakeLists.txt
    M llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/PowerPC/CMakeLists.txt
    M llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt
    M llvm/lib/Target/RISCV/CMakeLists.txt
    M llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/SPIRV/CMakeLists.txt
    M llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt
    M llvm/lib/Target/Sparc/CMakeLists.txt
    M llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/SystemZ/CMakeLists.txt
    M llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt
    M llvm/lib/Target/WebAssembly/CMakeLists.txt
    M llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/X86/CMakeLists.txt
    M llvm/lib/Target/X86/MCA/CMakeLists.txt
    M llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/XCore/CMakeLists.txt
    A llvm/lib/TargetParser/AArch64TargetParser.cpp
    A llvm/lib/TargetParser/ARMTargetParser.cpp
    A llvm/lib/TargetParser/ARMTargetParserCommon.cpp
    A llvm/lib/TargetParser/CMakeLists.txt
    A llvm/lib/TargetParser/CSKYTargetParser.cpp
    A llvm/lib/TargetParser/Host.cpp
    A llvm/lib/TargetParser/LoongArchTargetParser.cpp
    A llvm/lib/TargetParser/RISCVISAInfo.cpp
    A llvm/lib/TargetParser/TargetParser.cpp
    A llvm/lib/TargetParser/Triple.cpp
    A llvm/lib/TargetParser/Unix/Host.inc
    A llvm/lib/TargetParser/Windows/Host.inc
    A llvm/lib/TargetParser/X86TargetParser.cpp
    M llvm/lib/TextAPI/CMakeLists.txt
    M llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt
    M llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
    M llvm/lib/Transforms/CFGuard/CMakeLists.txt
    M llvm/lib/Transforms/IPO/CMakeLists.txt
    M llvm/lib/Transforms/Instrumentation/CMakeLists.txt
    M llvm/lib/Transforms/Utils/CMakeLists.txt
    M llvm/lib/WindowsDriver/CMakeLists.txt
    M llvm/lib/XRay/CMakeLists.txt
    M llvm/tools/bugpoint/CMakeLists.txt
    M llvm/tools/dsymutil/CMakeLists.txt
    M llvm/tools/gold/CMakeLists.txt
    M llvm/tools/llc/CMakeLists.txt
    M llvm/tools/lli/CMakeLists.txt
    M llvm/tools/llvm-ar/CMakeLists.txt
    M llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt
    M llvm/tools/llvm-config/CMakeLists.txt
    M llvm/tools/llvm-cov/CMakeLists.txt
    M llvm/tools/llvm-cxxfilt/CMakeLists.txt
    M llvm/tools/llvm-dwarfdump/CMakeLists.txt
    M llvm/tools/llvm-dwarfutil/CMakeLists.txt
    M llvm/tools/llvm-dwp/CMakeLists.txt
    M llvm/tools/llvm-exegesis/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
    M llvm/tools/llvm-gsymutil/CMakeLists.txt
    M llvm/tools/llvm-ifs/CMakeLists.txt
    M llvm/tools/llvm-isel-fuzzer/CMakeLists.txt
    M llvm/tools/llvm-jitlink/CMakeLists.txt
    M llvm/tools/llvm-jitlistener/CMakeLists.txt
    M llvm/tools/llvm-libtool-darwin/CMakeLists.txt
    M llvm/tools/llvm-lipo/CMakeLists.txt
    M llvm/tools/llvm-lto/CMakeLists.txt
    M llvm/tools/llvm-lto2/CMakeLists.txt
    M llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt
    M llvm/tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt
    M llvm/tools/llvm-mc/CMakeLists.txt
    M llvm/tools/llvm-mca/CMakeLists.txt
    M llvm/tools/llvm-ml/CMakeLists.txt
    M llvm/tools/llvm-nm/CMakeLists.txt
    M llvm/tools/llvm-objcopy/CMakeLists.txt
    M llvm/tools/llvm-objdump/CMakeLists.txt
    M llvm/tools/llvm-opt-fuzzer/CMakeLists.txt
    M llvm/tools/llvm-profgen/CMakeLists.txt
    M llvm/tools/llvm-rc/CMakeLists.txt
    M llvm/tools/llvm-readobj/CMakeLists.txt
    M llvm/tools/llvm-reduce/CMakeLists.txt
    M llvm/tools/llvm-rtdyld/CMakeLists.txt
    M llvm/tools/llvm-size/CMakeLists.txt
    M llvm/tools/llvm-tli-checker/CMakeLists.txt
    M llvm/tools/opt/CMakeLists.txt
    M llvm/tools/sancov/CMakeLists.txt
    M llvm/unittests/ADT/CMakeLists.txt
    R llvm/unittests/ADT/TripleTest.cpp
    M llvm/unittests/Analysis/CMakeLists.txt
    M llvm/unittests/BinaryFormat/CMakeLists.txt
    M llvm/unittests/CMakeLists.txt
    M llvm/unittests/CodeGen/CMakeLists.txt
    M llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt
    M llvm/unittests/DebugInfo/DWARF/CMakeLists.txt
    M llvm/unittests/DebugInfo/LogicalView/CMakeLists.txt
    M llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
    M llvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt
    M llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
    M llvm/unittests/Frontend/CMakeLists.txt
    M llvm/unittests/MC/AMDGPU/CMakeLists.txt
    M llvm/unittests/MC/CMakeLists.txt
    M llvm/unittests/MC/SystemZ/CMakeLists.txt
    M llvm/unittests/MC/X86/CMakeLists.txt
    M llvm/unittests/MI/CMakeLists.txt
    M llvm/unittests/MIR/CMakeLists.txt
    M llvm/unittests/Object/CMakeLists.txt
    M llvm/unittests/Support/CMakeLists.txt
    R llvm/unittests/Support/CSKYTargetParserTest.cpp
    R llvm/unittests/Support/Host.cpp
    R llvm/unittests/Support/TargetParserTest.cpp
    M llvm/unittests/Target/AArch64/CMakeLists.txt
    M llvm/unittests/Target/AMDGPU/CMakeLists.txt
    M llvm/unittests/Target/ARM/CMakeLists.txt
    M llvm/unittests/Target/PowerPC/CMakeLists.txt
    M llvm/unittests/Target/WebAssembly/CMakeLists.txt
    M llvm/unittests/Target/X86/CMakeLists.txt
    A llvm/unittests/TargetParser/CMakeLists.txt
    A llvm/unittests/TargetParser/CSKYTargetParserTest.cpp
    A llvm/unittests/TargetParser/Host.cpp
    A llvm/unittests/TargetParser/TargetParserTest.cpp
    A llvm/unittests/TargetParser/TripleTest.cpp
    M llvm/unittests/Transforms/IPO/CMakeLists.txt
    M llvm/unittests/Transforms/Vectorize/CMakeLists.txt
    M llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/CMakeLists.txt
    M llvm/unittests/tools/llvm-mca/CMakeLists.txt
    M mlir/lib/ExecutionEngine/CMakeLists.txt
    M mlir/lib/Target/LLVMIR/CMakeLists.txt
    M polly/lib/CMakeLists.txt

  Log Message:
  -----------
  [Support] Move TargetParsers to new component

This is a fairly large changeset, but it can be broken into a few
pieces:
- `llvm/Support/*TargetParser*` are all moved from the LLVM Support
  component into a new LLVM Component called "TargetParser". This
  potentially enables using tablegen to maintain this information, as
  is shown in https://reviews.llvm.org/D137517. This cannot currently
  be done, as llvm-tblgen relies on LLVM's Support component.
- This also moves two files from Support which use and depend on
  information in the TargetParser:
  - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting
    the current Host machine for info about it, primarily to support
    getting the host triple, but also for `-mcpu=native` support in e.g.
    Clang. This is fairly tightly intertwined with the information in
    `X86TargetParser.h`, so keeping them in the same component makes
    sense.
  - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains
    the target triple parser and representation. This is very intertwined
    with the Arm target parser, because the arm architecture version
    appears in canonical triples on arm platforms.
- I moved the relevant unittests to their own directory.

And so, we end up with a single component that has all the information
about the following, which to me seems like a unified component:
- Triples that LLVM Knows about
- Architecture names and CPUs that LLVM knows about
- CPU detection logic for LLVM

Given this, I have also moved `RISCVISAInfo.h` into this component, as
it seems to me to be part of that same set of functionality.

If you get link errors in your components after this patch, you likely
need to add TargetParser into LLVM_LINK_COMPONENTS in CMake.

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




More information about the All-commits mailing list