Skip to content

Commit

Permalink
[compiler][NFC] Reorganize Quidditch HAL target into Target directory
Browse files Browse the repository at this point in the history
  • Loading branch information
zero9178 committed Jun 20, 2024
1 parent a646144 commit 28276da
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 82 deletions.
3 changes: 2 additions & 1 deletion codegen/compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(src)
iree_add_all_subdirs()

3 changes: 2 additions & 1 deletion codegen/compiler/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
iree_setup_c_src_root(IMPLICIT_DEFS_TARGET quidditch_defs)

add_subdirectory(Quidditch)
iree_add_all_subdirs()

80 changes: 1 addition & 79 deletions codegen/compiler/src/Quidditch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,79 +1 @@
iree_compiler_register_plugin(
PLUGIN_ID
hal_target_quidditch
TARGET
::Quidditch
)

iree_tablegen_library(
NAME
PassesIncGen
TD_FILE
"Passes.td"
OUTS
--gen-pass-decls Passes.h.inc
)

iree_cc_library(
NAME
QuidditchPasses
HDRS
"Passes.h"
"Passes.h.inc"
SRCS
"ConvertToRISCV.cpp"
"DisableQuidditchVariant.cpp"
"OutlineLinalgOpsToxDSL.cpp"
"LinkExecutables.cpp"
"ReluToMax.cpp"
DEPS
::PassesIncGen
MLIRFuncDialect
MLIRIR
iree::compiler::Dialect::HAL::IR
)

iree_cc_library(
NAME
Quidditch
SRCS
"QuidditchTarget.cpp"
DEPS
::QuidditchPasses
IREELinalgTransformDialect
LLVMAnalysis
LLVMBitReader
LLVMBitWriter
LLVMCore
LLVMLinker
LLVMSupport
LLVMTargetParser
LLVMRISCVAsmParser
LLVMRISCVCodeGen
LLVMRISCVDesc
LLVMRISCVInfo
MLIRArmNeonDialect
MLIRArmSMEDialect
MLIRArmSMEToLLVMIRTranslation
MLIRBuiltinToLLVMIRTranslation
MLIRIR
MLIRLLVMDialect
MLIRLLVMToLLVMIRTranslation
MLIRPDLDialect
MLIRPDLInterpDialect
MLIRSupport
MLIRTargetLLVMIRExport
MLIRTransformDialect
iree::compiler::Codegen::Common
iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect
iree::compiler::Codegen::LLVMCPU
iree::compiler::Codegen::Utils
iree::compiler::Dialect::HAL::Target
iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils
iree::compiler::Dialect::LinalgExt::IR
iree::compiler::Dialect::Util::IR
iree::compiler::PluginAPI
iree::compiler::Utils
iree::compiler::plugins::target::LLVMCPU
PUBLIC
)
iree_add_all_subdirs()
80 changes: 80 additions & 0 deletions codegen/compiler/src/Quidditch/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
iree_compiler_register_plugin(
PLUGIN_ID
hal_target_quidditch
TARGET
::Quidditch
)

iree_tablegen_library(
NAME
PassesIncGen
TD_FILE
"Passes.td"
OUTS
--gen-pass-decls Passes.h.inc
)

iree_cc_library(
NAME
Passes
HDRS
"Passes.h"
"Passes.h.inc"
SRCS
"ConvertToRISCV.cpp"
"DisableQuidditchVariant.cpp"
"OutlineLinalgOpsToxDSL.cpp"
"LinkExecutables.cpp"
"ReluToMax.cpp"
DEPS
::PassesIncGen
MLIRFuncDialect
MLIRIR
iree::compiler::Dialect::HAL::IR
)

iree_cc_library(
NAME
Quidditch
SRCS
"QuidditchTarget.cpp"
DEPS
::Passes
Quidditch::Dialect::Snitch::QuidditchSnitchDialect
IREELinalgTransformDialect
LLVMAnalysis
LLVMBitReader
LLVMBitWriter
LLVMCore
LLVMLinker
LLVMSupport
LLVMTargetParser
LLVMRISCVAsmParser
LLVMRISCVCodeGen
LLVMRISCVDesc
LLVMRISCVInfo
MLIRArmNeonDialect
MLIRArmSMEDialect
MLIRArmSMEToLLVMIRTranslation
MLIRBuiltinToLLVMIRTranslation
MLIRIR
MLIRLLVMDialect
MLIRLLVMToLLVMIRTranslation
MLIRPDLDialect
MLIRPDLInterpDialect
MLIRSupport
MLIRTargetLLVMIRExport
MLIRTransformDialect
iree::compiler::Codegen::Common
iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect
iree::compiler::Codegen::LLVMCPU
iree::compiler::Codegen::Utils
iree::compiler::Dialect::HAL::Target
iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils
iree::compiler::Dialect::LinalgExt::IR
iree::compiler::Dialect::Util::IR
iree::compiler::PluginAPI
iree::compiler::Utils
iree::compiler::plugins::target::LLVMCPU
PUBLIC
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ def DisableQuidditchVariantPass : Pass<"quidditch-disable-variant",

def ReluToMaxPass : Pass<"quidditch-relu-to-max">;

def TileForL1Pass : Pass<"quidditch-tile-for-l1"> {
let options = [
Option<"l1CacheSize", "l1-cache-sizeo", "std::string", [{""}],
"Path to the 'xdsl-opt' executable to use for kernel compilation.">,
];
}

#endif
2 changes: 1 addition & 1 deletion codegen/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ add_executable(quidditch-opt quidditch-opt.cpp)
target_link_libraries(quidditch-opt
PRIVATE
MLIROptLib
Quidditch::QuidditchPasses
Quidditch::Target::Passes
iree::compiler::Dialect::LinalgExt::IR
iree::compiler::Tools::init_passes_and_dialects
)

0 comments on commit 28276da

Please sign in to comment.