| Issue |
71150
|
| Summary |
[mlir] --tosa-to-scf --canonicalize crashed with assertion failure "succeeded(ConcreteT::verify(getDefaultDiagnosticEmitFn(ctx), args...))"
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
anonymousMCS
|
git version: a1358225c5b791fa9d901e74fb09606189c0e6af
system: ```Ubuntu 20.04.6 LTS (Focal Fossa)```
reproduced with: ```mlir-opt --tosa-to-scf --canonicalize a.mlir```
a.mlir:
```
func.func private @func2() {
%c11 = arith.constant 11 : index
%c21 = arith.constant 21 : index
%c6 = arith.constant 6 : index
%c27 = arith.constant 27 : index
%c19 = arith.constant 19 : index
%45 = affine.apply affine_map<(d0)[s0] -> (-((d0 mod 4) mod 16 + 4))>(%c21)[%c11]
%c30 = arith.constant 30 : index
%c31 = arith.constant 31 : index
%20 = tensor.empty(%c27, %c6, %c31) : tensor<?x?x?xi1>
%55 = tensor.empty() : tensor<16x2xi32>
%123 = "tosa.bitwise_not"(%20) : (tensor<?x?x?xi1>) -> tensor<?x?x?xi1>
%129 = tensor.empty(%c19, %c27, %45) : tensor<?x?x?xi1>
%130 = "tosa.add"(%123, %129) : (tensor<?x?x?xi1>, tensor<?x?x?xi1>) -> tensor<?x?x?xi1>
%152 = tensor.empty(%c31, %c30, %45) : tensor<?x?x?xi1>
%153 = "tosa.scatter"(%130, %55, %152) : (tensor<?x?x?xi1>, tensor<16x2xi32>, tensor<?x?x?xi1>) -> tensor<?x?x?xi1>
return
}
```
trace:
```
mlir-opt: /data/bin/llvm-project/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase<ConcreteT, BaseT, StorageT, UniquerT, Traits>::get(mlir::MLIRContext*, Args&& ...) [with Args = {llvm::ArrayRef<long int>&, mlir::Type&, mlir::Attribute&}; ConcreteT = mlir::RankedTensorType; BaseT = mlir::TensorType; StorageT = mlir::detail::RankedTensorTypeStorage; UniquerT = mlir::detail::TypeUniquer; Traits = {mlir::ShapedType::Trait}]: Assertion `succeeded(ConcreteT::verify(getDefaultDiagnosticEmitFn(ctx), args...))' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /data/bin/llvm-project/build/bin/mlir-opt --tosa-to-scf --canonicalize a.mlir
#0 0x0000564cc8ca38bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/bin/llvm-project/build/bin/mlir-opt+0x15db8bf)
#1 0x0000564cc8ca0954 SignalHandler(int) Signals.cpp:0:0
#2 0x00007fb8c0a7f420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007fb8c056a00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007fb8c0549859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x00007fb8c0549729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#6 0x00007fb8c055afd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#7 0x0000564ccb9c009f mlir::RankedTensorType mlir::detail::StorageUserBase<mlir::RankedTensorType, mlir::TensorType, mlir::detail::RankedTensorTypeStorage, mlir::detail::TypeUniquer, mlir::ShapedType::Trait>::get<llvm::ArrayRef<long>&, mlir::Type&, mlir::Attribute&>(mlir::MLIRContext*, llvm::ArrayRef<long>&, mlir::Type&, mlir::Attribute&) (/data/bin/llvm-project/build/bin/mlir-opt+0x42f809f)
#8 0x0000564ccb9c00ed mlir::RankedTensorType::get(llvm::ArrayRef<long>, mlir::Type, mlir::Attribute) (/data/bin/llvm-project/build/bin/mlir-opt+0x42f80ed)
#9 0x0000564cca948c22 mlir::tensor::ExtractSliceOp::inferCanonicalRankReducedResultType(unsigned int, mlir::RankedTensorType, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>) (/data/bin/llvm-project/build/bin/mlir-opt+0x3280c22)
#10 0x0000564cca949043 mlir::tensor::ExtractSliceOp::inferCanonicalRankReducedResultType(unsigned int, mlir::RankedTensorType, llvm::ArrayRef<mlir::OpFoldResult>, llvm::ArrayRef<mlir::OpFoldResult>, llvm::ArrayRef<mlir::OpFoldResult>) (/data/bin/llvm-project/build/bin/mlir-opt+0x3281043)
#11 0x0000564cca97a434 (anonymous namespace)::InsertSliceOpConstantArgumentFolder<mlir::tensor::InsertSliceOp>::matchAndRewrite(mlir::tensor::InsertSliceOp, mlir::PatternRewriter&) const TensorOps.cpp:0:0
#12 0x0000564cc94a09ea mlir::detail::OpOrInterfaceRewritePatternBase<mlir::tensor::InsertSliceOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data/bin/llvm-project/build/bin/mlir-opt+0x1dd89ea)
#13 0x0000564cce529688 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&)>) (/data/bin/llvm-project/build/bin/mlir-opt+0x6e61688)
#14 0x0000564ccb8d463c (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#15 0x0000564ccb8d8aab mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/data/bin/llvm-project/build/bin/mlir-opt+0x4210aab)
#16 0x0000564ccb83e17a (anonymous namespace)::Canonicalizer::runOnOperation() Canonicalizer.cpp:0:0
#17 0x0000564ccb81f0ce mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/bin/llvm-project/build/bin/mlir-opt+0x41570ce)
#18 0x0000564ccb81f5aa mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/bin/llvm-project/build/bin/mlir-opt+0x41575aa)
#19 0x0000564ccb81fdd4 mlir::PassManager::run(mlir::Operation*) (/data/bin/llvm-project/build/bin/mlir-opt+0x4157dd4)
#20 0x0000564ccb810b5b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x0000564ccb812014 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#22 0x0000564ccb8121c4 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#23 0x0000564ccb911124 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/data/bin/llvm-project/build/bin/mlir-opt+0x4249124)
#24 0x0000564ccb80ac77 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/bin/llvm-project/build/bin/mlir-opt+0x4142c77)
#25 0x0000564ccb812311 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x414a311)
#26 0x0000564ccb812776 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x414a776)
#27 0x0000564cc8bdae3b main (/data/bin/llvm-project/build/bin/mlir-opt+0x1512e3b)
#28 0x00007fb8c054b083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#29 0x0000564cc8c73f8e _start (/data/bin/llvm-project/build/bin/mlir-opt+0x15abf8e)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs