[PATCH] D137517: [TargetSupport] Generate the defs for RISCV CPUs using llvm-tblgen.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 11:15:11 PST 2022


fpetrogalli added inline comments.


================
Comment at: llvm/lib/TargetSupport/CMakeLists.txt:2
+
+set(LLVM_TARGET_DEFINITIONS ${CMAKE_SOURCE_DIR}/lib/Target/RISCV/RISCV.td)
+
----------------
tmatheson wrote:
> Here `RISCVTargetSupportTableGen` depends on files in `lib/Target/RISCV`, meaning the folder structure doesn't reflect the dependency graph and it looks like a circular dependency. It would be cleaner to keep the `TargetParser` data out of `lib/Target` in e.g. `llvm/lib/TargetSupport/RISCVTargetInfo.td`. If it is needed in `RISCV.td` it could be included from there.
The generator needs the field `Name` which is stored in the class `ProcessorModel`. Moving instances of `ProcessorModel` out of `lib/Target/RISCV/RISCV.td` seems quite a major change, not just a matter of including a file. I'll give it a go anyway and report back.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137517/new/

https://reviews.llvm.org/D137517



More information about the llvm-commits mailing list