metagraph-dev / mlir-graphblas

MLIR tools and dialect for GraphBLAS
https://mlir-graphblas.readthedocs.io/en/latest/
Apache License 2.0
15 stars 6 forks source link

test_update.mlir errors with --graphblas-structuralize #277

Open paul-tqh-nguyen opened 2 years ago

paul-tqh-nguyen commented 2 years ago

I was under the impression that the below should get us a human-readable error message.

(build_mlir) pnguyen@CONDA-0584:/Users/pnguyen/code/mlir-graphblas/mlir_graphblas/src/test/GraphBLAS$ cat test_update.mlir | ~/code/mlir-graphblas/mlir_graphblas/src/build/bin/graphblas-opt --graphblas-structuralize | tersify_mlir
LLVM ERROR: can't create type 'mlir::LLVM::LLVMPointerType' because storage uniquer isn't initialized: the dialect was likely not loaded, or the type wasn't added with addTypes<...>() in the Dialect::initialize() method.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /Users/pnguyen/code/mlir-graphblas/mlir_graphblas/src/build/bin/graphblas-opt --graphblas-structuralize
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  graphblas-opt            0x000000010402048b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  graphblas-opt            0x000000010401f0f8 llvm::sys::RunSignalHandlers() + 248
2  graphblas-opt            0x0000000104020af7 SignalHandler(int) + 295
3  libsystem_platform.dylib 0x00007fff2068bd7d _sigtramp + 29
4  libsystem_platform.dylib 0x00000001114be223 _sigtramp + 18446603344557581507
5  libsystem_c.dylib        0x00007fff2059a720 abort + 120
6  graphblas-opt            0x000000010470d9f6 llvm::report_fatal_error(llvm::Twine const&, bool) + 406
7  graphblas-opt            0x0000000102e43512 std::__1::enable_if<!(std::is_same<mlir::LLVM::LLVMPointerType::ImplType, mlir::TypeStorage>::value), mlir::LLVM::LLVMPointerType>::type mlir::detail::TypeUniquer::get<mlir::LLVM::LLVMPointerType, mlir::Type&, unsigned int&>(mlir::MLIRContext*, mlir::Type&, unsigned int&) + 514
8  graphblas-opt            0x0000000102e3e63a mlir::LLVM::LLVMPointerType mlir::detail::StorageUserBase<mlir::LLVM::LLVMPointerType, mlir::Type, mlir::LLVM::detail::LLVMPointerTypeStorage, mlir::detail::TypeUniquer, mlir::DataLayoutTypeInterface::Trait>::get<mlir::Type, unsigned int>(mlir::MLIRContext*, mlir::Type, unsigned int) + 138
9  graphblas-opt            0x0000000102e3e598 mlir::LLVM::LLVMPointerType::get(mlir::Type, unsigned int) + 40
10 graphblas-opt            0x000000010354d100 castToPtr8(mlir::OpBuilder&, mlir::ModuleOp&, mlir::Location, mlir::Value) + 160
11 graphblas-opt            0x000000010354ef5c callResizeIndex(mlir::OpBuilder&, mlir::ModuleOp&, mlir::Location, mlir::Value, mlir::Value, mlir::Value) + 92
12 graphblas-opt            0x0000000103575d39 computeVectorElementWise(mlir::PatternRewriter&, mlir::Location, mlir::ModuleOp, mlir::Value, mlir::Value, mlir::Value, mlir::Block*, EwiseBehavior) + 2025
13 graphblas-opt            0x0000000103506ffe (anonymous namespace)::LowerUpdateRewrite::matchAndRewrite(mlir::graphblas::UpdateOp, mlir::PatternRewriter&) const + 1518
14 graphblas-opt            0x000000010350699e mlir::detail::OpOrInterfaceRewritePatternBase<mlir::graphblas::UpdateOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const + 62
15 graphblas-opt            0x0000000103e9bb70 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1440
16 graphblas-opt            0x0000000103e6b861 mlir::applyPatternsAndFoldGreedily(llvm::MutableArrayRef<mlir::Region>, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 4049
17 graphblas-opt            0x00000001034a2592 mlir::applyPatternsAndFoldGreedily(mlir::Operation*, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 82
18 graphblas-opt            0x00000001035266ff (anonymous namespace)::GraphBLASStructuralizePass::runOnOperation() + 335
19 graphblas-opt            0x0000000103ea45cb mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 523
20 graphblas-opt            0x0000000103ea4b96 mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::__1::unique_ptr<mlir::Pass, std::__1::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 118
21 graphblas-opt            0x0000000103ea6471 mlir::PassManager::run(mlir::Operation*) + 641
22 graphblas-opt            0x0000000103883fe7 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) + 503
23 graphblas-opt            0x0000000103881c87 processBuffer(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) + 647
24 graphblas-opt            0x000000010388193f mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool) + 175
25 graphblas-opt            0x000000010388285d mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 2605
26 graphblas-opt            0x00000001027eddfa main + 122
27 libdyld.dylib            0x00007fff20662621 start + 1
28 libdyld.dylib            0x0000000000000002 start + 18446603339972598242
Using development graphblas-opt: /Users/pnguyen/code/mlir-graphblas/mlir_graphblas/src/build/bin/graphblas-opt
module {
}

(build_mlir) pnguyen@CONDA-0584:/Users/pnguyen/code/mlir-graphblas/mlir_graphblas/src/test/GraphBLAS$ 
seibert commented 2 years ago

This looks like the dependency on the LLVM dialect was not declared in the code? (Newer versions of MLIR have gotten more picky about this over time, it seems.)