Skip to content

Commit d840017

Browse files
committed
Initialize LLVM update to 99020b3c73c1e22fa388be8fd0c44391d40b3a38
1 parent ecc47c7 commit d840017

File tree

8 files changed

+34
-22
lines changed

8 files changed

+34
-22
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(soda-opt LANGUAGES CXX C)
33

44
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
55

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

88
find_package(MLIR REQUIRED CONFIG)
99

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ And follow one of our tutorials [here](docs/tutorials).
2727
This setup assumes that you have built LLVM and MLIR in `$BUILD_DIR` and
2828
installed it to `$PREFIX`.
2929
The current version of this project was tested with `llvm-project` commit:
30-
`d0a4450ecdaf124f9d422dbcba8cbdbeb50c836a`.
30+
`99020b3c73c1e22fa388be8fd0c44391d40b3a38`.
3131
Make sure you have the correct commit checked-out.
3232

3333
**Note**: Make sure to pass `-DLLVM_INSTALL_UTILS=ON` when building LLVM/MLIR

include/soda-c/Dialect/SODA.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SODA_C_DIALECT_SODA_H
22
#define SODA_C_DIALECT_SODA_H
33

4-
#include "mlir-c/Registration.h"
4+
#include "mlir-c/IR.h"
55

66
#ifdef __cplusplus
77
extern "C" {

include/soda/Dialect/SNN/IR/SNNTypesBase.td

+15-15
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,21 @@ class ArrayMaxCt<int n> : AttrConstraint<
203203
CPred<"$_self.cast<::mlir::ArrayAttr>().size() <= " # n>,
204204
"with at least " # n # " elements">;
205205

206-
def SNN_Fp32ArrayAttr2 : Confined<F32ArrayAttr, [ArrayCount<2>]>;
207-
def SNN_Fp32ArrayAttr3 : Confined<F32ArrayAttr, [ArrayCount<3>]>;
208-
def SNN_Fp32ArrayAttr4 : Confined<F32ArrayAttr, [ArrayCount<4>]>;
209-
def SNN_Fp32ArrayAttr5 : Confined<F32ArrayAttr, [ArrayCount<5>]>;
210-
def SNN_Fp32ArrayAttr6 : Confined<F32ArrayAttr, [ArrayCount<6>]>;
211-
212-
def SNN_IntArrayAttr2 : Confined<I64ArrayAttr, [ArrayCount<2>]>;
213-
def SNN_IntArrayAttr3 : Confined<I64ArrayAttr, [ArrayCount<3>]>;
214-
def SNN_IntArrayAttr4 : Confined<I64ArrayAttr, [ArrayCount<4>]>;
215-
def SNN_IntArrayAttr5 : Confined<I64ArrayAttr, [ArrayCount<5>]>;
216-
def SNN_IntArrayAttr6 : Confined<I64ArrayAttr, [ArrayCount<6>]>;
217-
218-
def SNN_IntArrayAttrUpto2 : Confined<I64ArrayAttr, [ArrayMaxCt<2>]>;
219-
def SNN_IntArrayAttrUpto4 : Confined<I64ArrayAttr, [ArrayMaxCt<4>]>;
220-
def SNN_IntArrayAttrUpto5 : Confined<I64ArrayAttr, [ArrayMaxCt<5>]>;
206+
def SNN_Fp32ArrayAttr2 : ConfinedAttr<F32ArrayAttr, [ArrayCount<2>]>;
207+
def SNN_Fp32ArrayAttr3 : ConfinedAttr<F32ArrayAttr, [ArrayCount<3>]>;
208+
def SNN_Fp32ArrayAttr4 : ConfinedAttr<F32ArrayAttr, [ArrayCount<4>]>;
209+
def SNN_Fp32ArrayAttr5 : ConfinedAttr<F32ArrayAttr, [ArrayCount<5>]>;
210+
def SNN_Fp32ArrayAttr6 : ConfinedAttr<F32ArrayAttr, [ArrayCount<6>]>;
211+
212+
def SNN_IntArrayAttr2 : ConfinedAttr<I64ArrayAttr, [ArrayCount<2>]>;
213+
def SNN_IntArrayAttr3 : ConfinedAttr<I64ArrayAttr, [ArrayCount<3>]>;
214+
def SNN_IntArrayAttr4 : ConfinedAttr<I64ArrayAttr, [ArrayCount<4>]>;
215+
def SNN_IntArrayAttr5 : ConfinedAttr<I64ArrayAttr, [ArrayCount<5>]>;
216+
def SNN_IntArrayAttr6 : ConfinedAttr<I64ArrayAttr, [ArrayCount<6>]>;
217+
218+
def SNN_IntArrayAttrUpto2 : ConfinedAttr<I64ArrayAttr, [ArrayMaxCt<2>]>;
219+
def SNN_IntArrayAttrUpto4 : ConfinedAttr<I64ArrayAttr, [ArrayMaxCt<4>]>;
220+
def SNN_IntArrayAttrUpto5 : ConfinedAttr<I64ArrayAttr, [ArrayMaxCt<5>]>;
221221

222222
//===----------------------------------------------------------------------===//
223223
// Iterable attributes.

python/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ add_mlir_python_common_capi_library(SODAPythonCAPI
4040
RELATIVE_INSTALL_ROOT "../../../.."
4141
DECLARED_SOURCES
4242
SODAPythonSources
43+
MLIRPythonExtension.RegisterEverything
4344
MLIRPythonSources.Core
4445
)
4546

test/CAPI/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add_mlir_aggregate(SODACAPITestLib
66
SHARED
77
EMBED_LIBS
88
MLIRCAPIIR
9-
MLIRCAPIRegistration
9+
MLIRCAPIRegisterEverything
1010
SODACAPI
1111
)
1212

test/CAPI/soda-capi-test.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66

77
#include "mlir-c/IR.h"
88
#include "soda-c/Dialect/SODA.h"
9+
#include "mlir-c/RegisterEverything.h"
10+
11+
static void registerAllUpstreamDialects(MlirContext ctx) {
12+
MlirDialectRegistry registry = mlirDialectRegistryCreate();
13+
mlirRegisterAllDialects(registry);
14+
mlirContextAppendDialectRegistry(ctx, registry);
15+
mlirDialectRegistryDestroy(registry);
16+
}
917

1018
int main(int argc, char **argv) {
1119
MlirContext ctx = mlirContextCreate();
1220
// TODO: Create the dialect handles for the builtin dialects and avoid this.
1321
// This adds dozens of MB of binary size over just the standalone dialect.
14-
mlirRegisterAllDialects(ctx);
22+
registerAllUpstreamDialects(ctx);
1523
mlirDialectHandleRegisterDialect(mlirGetDialectHandle__soda__(), ctx);
1624

1725
MlirModule module = mlirModuleCreateParse(

tools/soda-opt/soda-opt.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ int registerTestLinalgCodegenStrategy();
3737
// Register important linalg passes
3838
inline void registerLinalgPassesForSoda() {
3939

40-
mlir::registerLinalgPromotionPass();
40+
// TODO: MLIR removed the promotion pass. Expose it to the command line.
41+
// mlir::registerLinalgPromotionPass();
4142
// Test passes
42-
mlir::test::registerTestLinalgCodegenStrategy();
43+
// mlir::test::registerTestLinalgCodegenStrategy();
44+
45+
mlir::registerLinalgPasses();
4346
}
4447

4548
// Register important affine passes

0 commit comments

Comments
 (0)