Skip to content

Commit

Permalink
CodeGen_MLIR: Add initial MLIR CodeGen
Browse files Browse the repository at this point in the history
  • Loading branch information
xerpi committed May 21, 2023
1 parent d234143 commit 129964e
Show file tree
Hide file tree
Showing 4 changed files with 625 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dependencies/llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release RelWithDebInfo "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel "")
set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release MinSizeRel RelWithDebInfo "")

find_package(LLVM ${Halide_REQUIRE_LLVM_VERSION} REQUIRED)
find_package(MLIR ${Halide_REQUIRE_LLVM_VERSION} REQUIRED)
find_package(Clang REQUIRED CONFIG HINTS "${LLVM_DIR}/../clang" "${LLVM_DIR}/../lib/cmake/clang")

set(LLVM_PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}"
Expand All @@ -19,6 +19,7 @@ set(LLVM_PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}"
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")

if (LLVM_PACKAGE_VERSION VERSION_LESS 14.0)
message(FATAL_ERROR "LLVM version must be 14.0 or newer")
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(HEADER_FILES
CodeGen_Internal.h
CodeGen_LLVM.h
CodeGen_Metal_Dev.h
CodeGen_MLIR.h
CodeGen_OpenCL_Dev.h
CodeGen_OpenGLCompute_Dev.h
CodeGen_Posix.h
Expand Down Expand Up @@ -201,6 +202,7 @@ set(SOURCE_FILES
CodeGen_Internal.cpp
CodeGen_LLVM.cpp
CodeGen_Metal_Dev.cpp
CodeGen_MLIR.cpp
CodeGen_OpenCL_Dev.cpp
CodeGen_OpenGLCompute_Dev.cpp
CodeGen_Posix.cpp
Expand Down
Loading

0 comments on commit 129964e

Please sign in to comment.