Skip to content

Commit 7ebf3c4

Browse files
whitneywhtsangetiotto
authored andcommitted
Add SYCLDialect to polygeist-opt (#42)
`polygeist-opt` is useful to call specific pass(es). This PR adds the `SYCLDialect` to `polygeist-opt`. Before this PR, if the input MLIR contains SYCL dialect, it would fail with e.g., ``` error: ... type created with unregistered dialect. ... ``` Example of using `polygeist-opt`: ``` sycl-mlir/build/bin/polygeist-opt t.mlir -convert-polygeist-to-llvm ``` Signed-off-by: Tsang, Whitney <[email protected]>
1 parent 32cbe32 commit 7ebf3c4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

polygeist/tools/polygeist-opt/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set(LIBS
66
MLIROptLib
77
MLIRPolygeist
88
MLIRPolygeistTransforms
9+
MLIRSYCLDialect
910
)
1011
add_llvm_executable(polygeist-opt polygeist-opt.cpp)
1112

polygeist/tools/polygeist-opt/polygeist-opt.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "mlir/Dialect/MemRef/IR/MemRef.h"
2525
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
2626
#include "mlir/Dialect/SCF/IR/SCF.h"
27+
#include "mlir/Dialect/SYCL/IR/SYCLOpsDialect.h"
2728
#include "mlir/InitAllPasses.h"
2829
#include "mlir/Pass/PassRegistry.h"
2930
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
@@ -60,6 +61,7 @@ int main(int argc, char **argv) {
6061
registry.insert<DLTIDialect>();
6162

6263
registry.insert<mlir::polygeist::PolygeistDialect>();
64+
registry.insert<mlir::sycl::SYCLDialect>();
6365

6466
mlir::registerpolygeistPasses();
6567

0 commit comments

Comments
 (0)