-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:coreMLIR Core InfrastructureMLIR Core Infrastructure
Description
git version: 56600c1
system: Ubuntu 18.04.6 LTS
reproduce with: mlir-opt a.mlir --canonicalize
a.mlir:
#map2 = affine_map<()[s0, s1] -> (s0 + s1)>
#map13 = affine_map<()[s0] -> ((s0 mod s0) * 4)>
#map14 = affine_map<()[s0, s1] -> ((((s0 floordiv s0) floordiv s0) mod s1) * 4)>
module {
llvm.func @free(!llvm.ptr) attributes {sym_visibility = "private"}
llvm.func @malloc(i64) -> !llvm.ptr attributes {sym_visibility = "private"}
func.func private @func1(%arg0: index, %arg1: memref<1x15x19xi32, strided<[?, ?, ?], offset: ?>>, %arg2: memref<1x15x19xi32, strided<[?, ?, ?], offset: ?>>) {
%18 = llvm.mlir.constant(3 : index) : i64
%19 = llvm.mlir.constant(1 : index) : i64
%20 = builtin.unrealized_conversion_cast %19 : i64 to index
%25 = llvm.mlir.zero : !llvm.ptr
%35 = llvm.mlir.constant(dense<"0x000000000100000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E0000000F000000100000001100000012000000130000001400000015000000160000001700000018000000190000001A0000001B0000001C0000001D0000001E0000001F000000200000002100000022000000230000002400000025000000260000002700000028000000290000002A0000002B0000002C0000002D0000002E0000002F000000300000003100000032000000330000003400000035000000360000003700000038000000390000003A0000003B0000003C0000003D0000003E0000003F000000400000004100000042000000430000004400000045000000460000004700000048000000490000004A0000004B0000004C0000004D0000004E0000004F000000500000005100000052000000530000005400000055000000560000005700000058000000590000005A0000005B0000005C0000005D0000005E0000005F000000600000006100000062000000630000006400000065000000660000006700000068000000690000006A0000006B0000006C0000006D0000006E0000006F000000700000007100000072000000730000007400000075000000760000007700000078000000790000007A0000007B0000007C0000007D0000007E0000007F000000"> : vector<128xi32>) : vector<128xi32>
%37 = builtin.unrealized_conversion_cast %18 : i64 to index
%272 = llvm.getelementptr %25[76] : (!llvm.ptr) -> !llvm.ptr, i32
%273 = llvm.ptrtoint %272 : !llvm.ptr to i64
%301 = llvm.call @malloc(%273) : (i64) -> !llvm.ptr
llvm.call @free(%301) : (!llvm.ptr) -> ()
%561 = affine.apply #map13()[%20]
%562 = affine.apply #map14()[%20, %37]
%563 = affine.apply #map2()[%561, %562]
return
}
}
stack trace:
mlir-opt: /data/szy/MLIR/llvm-experiment/llvm-project/llvm/include/llvm/Support/Casting.h:656: decltype(auto) llvm::dyn_cast(From &) [To = mlir::AffineBinaryOpExpr, From = mlir::AffineExpr]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' 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/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt a.mlir --canonicalize
#0 0x00005563fb6f8258 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x11f6258)
#1 0x00005563fb6f5d5e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x11f3d5e)
#2 0x00005563fb6f8bdd SignalHandler(int) Signals.cpp:0:0
#3 0x00007f46f56b7420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f46f4cf400b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f46f4cd3859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f46f4cd3729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f46f4cd3729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f46f4ce4fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x00005563fe6f0a7e getSummandExprs(mlir::AffineExpr, llvm::SmallVector<mlir::AffineExpr, 6u>&) AffineExpr.cpp:0:0
#10 0x00005563fe6ef58e simplifySemiAffine(mlir::AffineExpr, unsigned int, unsigned int) AffineExpr.cpp:0:0
#11 0x00005563fe6ef510 simplifySemiAffine(mlir::AffineExpr, unsigned int, unsigned int) AffineExpr.cpp:0:0
#12 0x00005563fe6ee7cb mlir::simplifyAffineExpr(mlir::AffineExpr, unsigned int, unsigned int) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x41ec7cb)
#13 0x00005563fe6f7cd1 mlir::simplifyAffineMap(mlir::AffineMap) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x41f5cd1)
#14 0x00005563fb78f75d composeAffineMapAndOperands(mlir::AffineMap*, llvm::SmallVectorImpl<mlir::Value>*) AffineOps.cpp:0:0
#15 0x00005563fb7f3ce8 (anonymous namespace)::SimplifyAffineOp<mlir::affine::AffineApplyOp>::matchAndRewrite(mlir::affine::AffineApplyOp, mlir::PatternRewriter&) const AffineOps.cpp:0:0
#16 0x0000556401758c91 void llvm::function_ref<void ()>::callback_fn<mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0>(long) PatternApplicator.cpp:0:0
#17 0x00005564017559b1 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x72539b1)
#18 0x00005563fe6bb5fb (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#19 0x00005563fe6b7fbf mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x41b5fbf)
#20 0x00005563fe6602e5 (anonymous namespace)::Canonicalizer::runOnOperation() Canonicalizer.cpp:0:0
#21 0x00005563fe642aa6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x4140aa6)
#22 0x00005563fe6433d0 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x41413d0)
#23 0x00005563fe645cd2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x4143cd2)
#24 0x00005563fe63e0fa performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#25 0x00005563fe63dd4d llvm::LogicalResult llvm::function_ref<llvm::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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#26 0x00005563fe6e8c35 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x41e6c35)
#27 0x00005563fe637d65 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x4135d65)
#28 0x00005563fe63800f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x413600f)
#29 0x00005563fe63833e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x413633e)
#30 0x00005563fb6d84c7 main (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x11d64c7)
#31 0x00007f46f4cd5083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#32 0x00005563fb6d803e _start (/data/szy/MLIR/llvm-experiment/llvm-project/build/bin/mlir-opt+0x11d603e)
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:coreMLIR Core InfrastructureMLIR Core Infrastructure