Convert AST nodes and "Operator" to prims (#325)
The AST contained nodes for polymorphic functions such as: index, size, print.
This PR is to "demote" those to polymorphic Calls. We still need special code in C++ to match these polymorphic functions, but that is now isolated to a sequence of pattern matches of the form
if (MATCH_2("index", Integer, Vector)) return...;
This matching happens in the type propagator and in the MLIR lowering. Ultimately many of these functions should be defined in the prelude, this is a first step to remove them from the AST.
The AST also distinguished "Operations" and "Calls". This distinction is absent in the rest of Knossos, and pertains only at lowering time.
The PR also includes other fixes, to build definition, test specification, assertion handling, pretty printing.
Co-authored-by: Colin Gravill <colin.gravill@microsoft.com>
2020-07-28 13:16:11 +03:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
|
2020-07-30 21:11:40 +03:00
|
|
|
project(KSC)
|
|
|
|
|
2020-08-03 20:53:34 +03:00
|
|
|
# Project-wide. llvm requires at least C++14.
|
|
|
|
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS NO)
|
|
|
|
|
Convert AST nodes and "Operator" to prims (#325)
The AST contained nodes for polymorphic functions such as: index, size, print.
This PR is to "demote" those to polymorphic Calls. We still need special code in C++ to match these polymorphic functions, but that is now isolated to a sequence of pattern matches of the form
if (MATCH_2("index", Integer, Vector)) return...;
This matching happens in the type propagator and in the MLIR lowering. Ultimately many of these functions should be defined in the prelude, this is a first step to remove them from the AST.
The AST also distinguished "Operations" and "Calls". This distinction is absent in the rest of Knossos, and pertains only at lowering time.
The PR also includes other fixes, to build definition, test specification, assertion handling, pretty printing.
Co-authored-by: Colin Gravill <colin.gravill@microsoft.com>
2020-07-28 13:16:11 +03:00
|
|
|
include("user.cmake")
|
|
|
|
|
2020-08-16 15:47:36 +03:00
|
|
|
# Check user.cmake defined what we need
|
2020-08-04 14:45:03 +03:00
|
|
|
if (NOT EXISTS "${MLIR_DIR}/MLIRConfig.cmake")
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"Could not find MLIRConfig.cmake\n"
|
|
|
|
"${CMAKE_SOURCE_DIR}/user.cmake defined MLIR_DIR as ${MLIR_DIR}\n"
|
|
|
|
"Expected to find MLIRConfig.cmake there")
|
|
|
|
endif()
|
|
|
|
|
Convert AST nodes and "Operator" to prims (#325)
The AST contained nodes for polymorphic functions such as: index, size, print.
This PR is to "demote" those to polymorphic Calls. We still need special code in C++ to match these polymorphic functions, but that is now isolated to a sequence of pattern matches of the form
if (MATCH_2("index", Integer, Vector)) return...;
This matching happens in the type propagator and in the MLIR lowering. Ultimately many of these functions should be defined in the prelude, this is a first step to remove them from the AST.
The AST also distinguished "Operations" and "Calls". This distinction is absent in the rest of Knossos, and pertains only at lowering time.
The PR also includes other fixes, to build definition, test specification, assertion handling, pretty printing.
Co-authored-by: Colin Gravill <colin.gravill@microsoft.com>
2020-07-28 13:16:11 +03:00
|
|
|
add_subdirectory(mlir)
|