-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[RFC][TableGen] Restructure TableGen Source #80847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The basic TableGen library contains as little dependencies as possible. | ||
# In particular, it does not depend on vt_gen -> it does not use ValueTypes. | ||
# | ||
# This library is the only thing included in `llvm-min-tablegen`. | ||
|
||
set(LLVM_LINK_COMPONENTS | ||
Support | ||
TableGen | ||
) | ||
|
||
add_llvm_library(LLVMTableGenBasic STATIC OBJECT EXCLUDE_FROM_ALL | ||
CodeGenIntrinsics.cpp | ||
SDNodeProperties.cpp | ||
) | ||
set_target_properties(LLVMTableGenBasic PROPERTIES FOLDER "Tablegenning") | ||
|
||
# Users may include its headers as "Basic/*.h" | ||
target_include_directories(LLVMTableGenBasic | ||
INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
add_subdirectory(GlobalISel) | ||
# Basic utilities which is the strict minimum needed to build | ||
# llvm-min-tblgen. | ||
add_subdirectory(Basic) | ||
# Common utilities are all of the reusable components and helper | ||
# code needed by the backends. | ||
add_subdirectory(Common) | ||
|
||
add_llvm_library(LLVMTableGenCommon STATIC OBJECT EXCLUDE_FROM_ALL | ||
set(LLVM_LINK_COMPONENTS Support) | ||
|
||
# llvm-min-tablegen only contains a subset of backends necessary to | ||
# build llvm/include. It must not depend on TableGenCommon, as | ||
# TableGenCommon depends on this already to generate things such as | ||
# ValueType definitions. | ||
add_tablegen(llvm-min-tblgen LLVM_HEADERS | ||
TableGen.cpp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep this source list alphabetized? |
||
Attributes.cpp | ||
CodeGenIntrinsics.cpp | ||
DirectiveEmitter.cpp | ||
IntrinsicEmitter.cpp | ||
RISCVTargetDefEmitter.cpp | ||
SDNodeProperties.cpp | ||
VTEmitter.cpp | ||
PARTIAL_SOURCES_INTENDED | ||
|
||
LINK_COMPONENTS | ||
Support | ||
TableGen | ||
) | ||
set_target_properties(LLVMTableGenCommon PROPERTIES FOLDER "Tablegenning") | ||
$<TARGET_OBJECTS:obj.LLVMTableGenBasic> | ||
|
||
set(LLVM_LINK_COMPONENTS Support) | ||
|
||
add_tablegen(llvm-min-tblgen LLVM_HEADERS | ||
TableGen.cpp | ||
$<TARGET_OBJECTS:obj.LLVMTableGenCommon> | ||
PARTIAL_SOURCES_INTENDED | ||
) | ||
set_target_properties(llvm-min-tblgen PROPERTIES FOLDER "Tablegenning") | ||
|
@@ -35,63 +34,51 @@ add_tablegen(llvm-tblgen LLVM | |
EXPORT LLVM | ||
AsmMatcherEmitter.cpp | ||
AsmWriterEmitter.cpp | ||
AsmWriterInst.cpp | ||
CTagsEmitter.cpp | ||
Attributes.cpp | ||
CallingConvEmitter.cpp | ||
CodeEmitterGen.cpp | ||
CodeGenDAGPatterns.cpp | ||
CodeGenHwModes.cpp | ||
CodeGenInstAlias.cpp | ||
CodeGenInstruction.cpp | ||
CodeGenMapTable.cpp | ||
CodeGenRegisters.cpp | ||
CodeGenSchedule.cpp | ||
CodeGenTarget.cpp | ||
CompressInstEmitter.cpp | ||
CTagsEmitter.cpp | ||
Comment on lines
+41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose we prefer reordering the file list by character code case sensitive. Could you follow? (I didn't do in the last time since I worked to be less intrusive) |
||
DAGISelEmitter.cpp | ||
DAGISelMatcherEmitter.cpp | ||
DAGISelMatcherGen.cpp | ||
DAGISelMatcherOpt.cpp | ||
DAGISelMatcher.cpp | ||
DecoderEmitter.cpp | ||
DFAEmitter.cpp | ||
DFAPacketizerEmitter.cpp | ||
DirectiveEmitter.cpp | ||
DisassemblerEmitter.cpp | ||
DXILEmitter.cpp | ||
ExegesisEmitter.cpp | ||
FastISelEmitter.cpp | ||
GlobalISelCombinerEmitter.cpp | ||
GlobalISelEmitter.cpp | ||
GlobalISelMatchTable.cpp | ||
GlobalISelMatchTableExecutorEmitter.cpp | ||
InfoByHwMode.cpp | ||
InstrInfoEmitter.cpp | ||
InstrDocsEmitter.cpp | ||
OptEmitter.cpp | ||
InstrInfoEmitter.cpp | ||
IntrinsicEmitter.cpp | ||
MacroFusionPredicatorEmitter.cpp | ||
OptParserEmitter.cpp | ||
OptRSTEmitter.cpp | ||
PredicateExpander.cpp | ||
PseudoLoweringEmitter.cpp | ||
CompressInstEmitter.cpp | ||
MacroFusionPredicatorEmitter.cpp | ||
RegisterBankEmitter.cpp | ||
RegisterInfoEmitter.cpp | ||
RISCVTargetDefEmitter.cpp | ||
SearchableTableEmitter.cpp | ||
SubtargetEmitter.cpp | ||
SubtargetFeatureInfo.cpp | ||
TableGen.cpp | ||
Types.cpp | ||
VarLenCodeEmitterGen.cpp | ||
X86DisassemblerTables.cpp | ||
VTEmitter.cpp | ||
WebAssemblyDisassemblerEmitter.cpp | ||
X86CompressEVEXTablesEmitter.cpp | ||
X86DisassemblerTables.cpp | ||
X86FoldTablesEmitter.cpp | ||
X86MnemonicTables.cpp | ||
X86ModRMFilters.cpp | ||
X86RecognizableInstr.cpp | ||
WebAssemblyDisassemblerEmitter.cpp | ||
$<TARGET_OBJECTS:obj.LLVMTableGenCommon> | ||
|
||
DEPENDS | ||
intrinsics_gen # via llvm-min-tablegen | ||
) | ||
target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenGlobalISel) | ||
target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenCommon) | ||
set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# The common library is similar to the basic library except it can | ||
# depend on vt_gen. | ||
# | ||
# This library contains the bulk of the supporting code for all | ||
# TableGen backends. It's split off as a separate library to | ||
# allow unit-testing those components. | ||
|
||
set(LLVM_LINK_COMPONENTS | ||
Support | ||
TableGen | ||
) | ||
|
||
add_llvm_library(LLVMTableGenCommon STATIC OBJECT EXCLUDE_FROM_ALL | ||
GlobalISel/CodeExpander.cpp | ||
GlobalISel/CXXPredicates.cpp | ||
GlobalISel/GlobalISelMatchTable.cpp | ||
GlobalISel/GlobalISelMatchTableExecutorEmitter.cpp | ||
GlobalISel/MatchDataInfo.cpp | ||
GlobalISel/Patterns.cpp | ||
|
||
AsmWriterInst.cpp | ||
CodeGenDAGPatterns.cpp | ||
CodeGenHwModes.cpp | ||
CodeGenInstAlias.cpp | ||
CodeGenInstruction.cpp | ||
CodeGenRegisters.cpp | ||
CodeGenSchedule.cpp | ||
CodeGenTarget.cpp | ||
DAGISelMatcher.cpp | ||
InfoByHwMode.cpp | ||
OptEmitter.cpp | ||
PredicateExpander.cpp | ||
SubtargetFeatureInfo.cpp | ||
Types.cpp | ||
VarLenCodeEmitterGen.cpp | ||
$<TARGET_OBJECTS:obj.LLVMTableGenBasic> | ||
|
||
DEPENDS | ||
vt_gen | ||
) | ||
set_target_properties(LLVMTableGenCommon PROPERTIES FOLDER "Tablegenning") | ||
target_link_libraries(LLVMTableGenCommon PUBLIC LLVMTableGenBasic) | ||
|
||
# Users may include its headers as "Common/*.h" | ||
target_include_directories(LLVMTableGenCommon | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tablegenning"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just copy pasted that. It seems like we tend to set that properties for tablegen-related stuff. Not sure why