Skip to content

Commit

Permalink
Update to LLVM commit 18ddebe1a1a9bde349441631365f0472e9693520 (#8)
Browse files Browse the repository at this point in the history
* Update to LLVM commit 18ddebe1a1a9bde349441631365f0472e9693520

* attempt to fix build action error by removing -DLLVM_OPTIMIZED_TABLEGEN=ON

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Kun Wu <[email protected]>
  • Loading branch information
3 people authored Apr 30, 2023
1 parent 8bf3ba2 commit c29a66e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
LLVM_COMMIT=refs/tags/llvmorg-15.0.6
LLVM_COMMIT=18ddebe1a1a9bde349441631365f0472e9693520
CMAKE_FLAGS='-DCMAKE_LINKER=lld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DMLIR_DIR=$GITHUB_WORKSPACE/llvm-project/prefix/lib/cmake/mlir/ -DLLVM_DIR=$GITHUB_WORKSPACE/llvm-project/prefix/lib/cmake/llvm/ -DLLVM_EXTERNAL_LIT=$GITHUB_WORKSPACE/llvm-project/build/bin/llvm-lit'
LLVM_REF=refs/tags/llvmorg-16.0.2
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/llvm-project/build
mkdir $GITHUB_WORKSPACE/llvm-project/prefix
cd $GITHUB_WORKSPACE/llvm-project/build
cmake $GITHUB_WORKSPACE/llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/llvm-project/prefix -DLLVM_ENABLE_PROJECTS='mlir' -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_OCAMLDOC=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INSTALL_UTILS=ON -DLLVM_ENABLE_LLD=ON
cmake $GITHUB_WORKSPACE/llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/llvm-project/prefix -DLLVM_ENABLE_PROJECTS='mlir' -DLLVM_ENABLE_OCAMLDOC=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INSTALL_UTILS=ON -DLLVM_ENABLE_LLD=ON
cmake --build . --target install -- -j$(nproc)
- name: Sanitizer build
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(standalone-dialect LANGUAGES CXX C)

set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)

set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")

find_package(MLIR REQUIRED CONFIG)

Expand Down
2 changes: 0 additions & 2 deletions include/Standalone/StandaloneDialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def Standalone_Dialect : Dialect {
working inside of the LLVM source tree.
}];
let cppNamespace = "::mlir::standalone";

let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}

//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion include/Standalone/StandaloneOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include "Standalone/StandaloneDialect.td"
include "mlir/Interfaces/InferTypeOpInterface.td"
include "mlir/Interfaces/SideEffectInterfaces.td"

def Standalone_FooOp : Standalone_Op<"foo", [NoSideEffect,
def Standalone_FooOp : Standalone_Op<"foo", [Pure,
SameOperandsAndResultType]> {
let summary = "Illustrates how to define an operation.";
let description = [{
Expand Down
4 changes: 2 additions & 2 deletions python/StandaloneExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ PYBIND11_MODULE(_standaloneDialects, m) {
//===--------------------------------------------------------------------===//
// standalone dialect
//===--------------------------------------------------------------------===//
auto standalone_m = m.def_submodule("standalone");
auto standaloneM = m.def_submodule("standalone");

standalone_m.def(
standaloneM.def(
"register_dialect",
[](MlirContext context, bool load) {
MlirDialectHandle handle = mlirGetDialectHandle__standalone__();
Expand Down
2 changes: 1 addition & 1 deletion standalone-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(LIBS
${dialect_libs}
${conversion_libs}
MLIRArithmeticDialect
MLIRArithDialect
MLIROptLib
MLIRStandalone
)
Expand Down
4 changes: 2 additions & 2 deletions standalone-opt/standalone-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/InitAllDialects.h"
Expand All @@ -28,7 +28,7 @@ int main(int argc, char **argv) {

mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect,
mlir::arith::ArithmeticDialect, mlir::func::FuncDialect>();
mlir::arith::ArithDialect, mlir::func::FuncDialect>();
// Add the following to include *all* MLIR Core dialects, or selectively
// include what you need like above. You only need to register dialects that
// will be *parsed* by the tool, not the one generated
Expand Down
10 changes: 8 additions & 2 deletions standalone-translate/standalone-translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@
//
//===----------------------------------------------------------------------===//

#include "Standalone/StandaloneDialect.h"
#include "mlir/InitAllTranslations.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Tools/mlir-translate/MlirTranslateMain.h"

#include "Standalone/StandaloneDialect.h"
#include "mlir/Tools/mlir-translate/Translation.h"

int main(int argc, char **argv) {
mlir::registerAllTranslations();

// TODO: Register standalone translations here.
mlir::TranslateFromMLIRRegistration withdescription(
"option", "different from option",
[](mlir::Operation *op, llvm::raw_ostream &output) {
return mlir::LogicalResult::success();
},
[](mlir::DialectRegistry &a) {});

return failed(
mlir::mlirTranslateMain(argc, argv, "MLIR Translation Testing Tool"));
Expand Down
3 changes: 0 additions & 3 deletions test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@LIT_SITE_CFG_IN_HEADER@

config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.mlir_obj_dir = "@MLIR_BINARY_DIR@"
config.python_executable = "@Python3_EXECUTABLE@"
config.enable_bindings_python = @MLIR_ENABLE_BINDINGS_PYTHON@
config.standalone_src_root = "@CMAKE_SOURCE_DIR@"
config.standalone_obj_root = "@CMAKE_BINARY_DIR@"

import lit.llvm
Expand Down

0 comments on commit c29a66e

Please sign in to comment.