Issue |
119866
|
Summary |
[mlir] -canonicalize crashes
|
Labels |
mlir
|
Assignees |
|
Reporter |
wwy6191
|
git version: bc29fc937c6cb4a210f80c93c79fc6ed97c801f8
system: `Ubuntu 18.04.6 LTS`
reproduce with: `mlir-opt -canonicalize a.mlir`
a.mlir:
```
func.func @test_muli() -> (i32) {
%0 = "test.constant"() {value = 0x7fffffff} : () -> i32
%1 = "test.constant"() {value = -2147483648} : () -> i32
%2 = "test.constant"() {value = 0x80000000} : () -> i32
%3 = "test.constant"() {value = 0xffffffff} : () -> i32
%4 = arith.muli %0, %1 : i32
%5 = arith.muli %4, %2 : i32
%6 = arith.muli %5, %3 : i32
return %6 : i32
}
```
stack trace:
```
<unknown>:0: error: integer type bit width (32) doesn't match value bit width (64)
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase<mlir::IntegerAttr, mlir::Attribute, mlir::detail::IntegerAttrStorage, mlir::detail::AttributeUniquer, mlir::TypedAttr::Trait>::get(MLIRContext *, Args &&...) [ConcreteT = mlir::IntegerAttr, BaseT = mlir::Attribute, StorageT = mlir::detail::IntegerAttrStorage, UniquerT = mlir::detail::AttributeUniquer, Traits = <mlir::TypedAttr::Trait>, Args = <mlir::Type &, const llvm::APInt &>]: Assertion `succeeded( ConcreteT::verifyInvariants(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/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -canonicalize /data/szy/MLIR/seed/seed0/tmp.RHhs0ejHK5.mlir
#0 0x0000556334f26348 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x111f348)
#1 0x0000556334f23e5e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x111ce5e)
#2 0x0000556334f26cdd SignalHandler(int) Signals.cpp:0:0
#3 0x00007f94d4d08420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f94d434500b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f94d4324859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f94d4324729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f94d4324729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f94d4335fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x0000556337f19a91 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4112a91)
#10 0x0000556337f1990f mlir::IntegerAttr::get(mlir::Type, llvm::APInt const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x411290f)
#11 0x000055633518d595 applyToIntegerAttrs(mlir::PatternRewriter&, mlir::Value, mlir::Attribute, mlir::Attribute, llvm::function_ref<llvm::APInt (llvm::APInt const&, llvm::APInt const&)>) ArithOps.cpp:0:0
#12 0x000055633519480e (anonymous namespace)::MulIMulIConstant::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const ArithOps.cpp:0:0
#13 0x000055633aef7591 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
#14 0x000055633aef425b 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-release/llvm-project/build/bin/mlir-opt+0x70ed25b)
#15 0x0000556337eaae7f (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#16 0x0000556337ea755f mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x40a055f)
#17 0x0000556337e4ebfb (anonymous namespace)::Canonicalizer::runOnOperation() Canonicalizer.cpp:0:0
#18 0x0000556337e313d6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x402a3d6)
#19 0x0000556337e31d00 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x402ad00)
#20 0x0000556337e342d2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x402d2d2)
#21 0x0000556337e2ca4a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#22 0x0000556337e2c69d 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
#23 0x0000556337ed8235 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-release/llvm-project/build/bin/mlir-opt+0x40d1235)
#24 0x0000556337e26685 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x401f685)
#25 0x0000556337e2692f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x401f92f)
#26 0x0000556337e26c5e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x401fc5e)
#27 0x0000556334f06e37 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10ffe37)
#28 0x00007f94d4326083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#29 0x0000556334f069ae _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10ff9ae)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs