-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Closed
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:arith
Description
git version: d097070
system: Ubuntu 18.04.6 LTS
reproduce with: mlir-opt -int-range-optimizations a.mlir
a.mlir:
module {
func.func @f(%arg0: f32) {
%c0 = arith.constant 0 : index
return
^BB1(%0: i32): // no predecessors
%cst = arith.constant 1.000000e+00 : f32
%c0_0 = arith.constant 0 : index
%c10 = arith.constant 10 : index
%c1 = arith.constant 1 : index
%alloc = memref.alloc() : memref<10xf32>
%c0_1 = arith.constant 0 : index
%c10_2 = arith.constant 10 : index
%c1_3 = arith.constant 1 : index
cf.br ^BB2(%c0_1 : index)
^BB2(%1: index): // 2 preds: ^BB1, ^BB3
%2 = arith.cmpi slt, %1, %c10 : index
cf.cond_br %2, ^BB3(%1 : index), ^BB4
^BB3(%3: index): // 2 preds: ^BB2, ^BB5
%4 = arith.cmpi slt, %3, %c10 : index
cf.cond_br %4, ^BB4, ^BB6
^BB4: // pred: ^BB3
%5 = memref.load %alloc[%1] : memref<10xf32>
%6 = arith.addf %5, %cst : f32
memref.store %6, %alloc[%1] : memref<10xf32>
%7 = arith.addi %3, %c1 : index
cf.br ^BB5(%7 : index)
^BB5(%8: index): // 2 preds: ^BB4, ^BB5
%9 = arith.cmpi slt, %8, %c10 : index
cf.cond_br %9, ^BB6, ^BB7
^BB6: // pred: ^BB5
%10 = arith.addi %8, %c1 : index
cf.br ^BB5(%10 : index)
^BB7: // pred: ^BB6
return
}
}
stack trace:
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/llvm/include/llvm/ADT/APInt.h:1044: bool llvm::APInt::operator[](unsigned int) const: Assertion `bitPosition < getBitWidth() && "Bit position out of bounds!"' 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 -int-range-optimizations /data/szy/MLIR/seed/seed15/tmp.PBBqjgej6E.mlir
#0 0x0000564c888a3f88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1185f88)
#1 0x0000564c888a1a9e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1183a9e)
#2 0x0000564c888a491d SignalHandler(int) Signals.cpp:0:0
#3 0x00007f16eb052420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f16ea68f00b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f16ea66e859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f16ea66e729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f16ea66e729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f16ea67ffd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x0000564c8e906c96 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x71e8c96)
#10 0x0000564c8de24c0f mlir::intrange::inferMinS(llvm::ArrayRef<mlir::ConstantIntRanges>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6706c0f)
#11 0x0000564c88b9c7b8 mlir::arith::MinSIOp::inferResultRanges(llvm::ArrayRef<mlir::ConstantIntRanges>, llvm::function_ref<void (mlir::Value, mlir::ConstantIntRanges const&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x147e7b8)
#12 0x0000564c88b6dd91 mlir::detail::InferIntRangeInterfaceInterfaceTraits::Model<mlir::arith::MinSIOp>::inferResultRanges(mlir::detail::InferIntRangeInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::ConstantIntRanges>, llvm::function_ref<void (mlir::Value, mlir::ConstantIntRanges const&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x144fd91)
#13 0x0000564c8e9076e6 mlir::intrange::detail::defaultInferResultRanges(mlir::InferIntRangeInterface, llvm::ArrayRef<mlir::IntegerValueRange>, llvm::function_ref<void (mlir::Value, mlir::IntegerValueRange const&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x71e96e6)
#14 0x0000564c8bcc7b6c mlir::dataflow::IntegerRangeAnalysis::visitOperation(mlir::Operation*, llvm::ArrayRef<mlir::dataflow::IntegerValueRangeLattice const*>, llvm::ArrayRef<mlir::dataflow::IntegerValueRangeLattice*>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45a9b6c)
#15 0x0000564c8bccc4f9 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::visitOperation(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45ae4f9)
#16 0x0000564c8bccbb99 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45adb99)
#17 0x0000564c8bccbe4d mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45ade4d)
#18 0x0000564c8bccbe4d mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45ade4d)
#19 0x0000564c8bc9bc8e mlir::DataFlowSolver::initializeAndRun(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x457dc8e)
#20 0x0000564c88bd707d (anonymous namespace)::IntRangeOptimizationsPass::runOnOperation() IntRangeOptimizations.cpp:0:0
#21 0x0000564c8bcde936 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c0936)
#22 0x0000564c8bcdf260 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+0x45c1260)
#23 0x0000564c8bce1832 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c3832)
#24 0x0000564c8bcda0da performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#25 0x0000564c8bcd9d2d 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 0x0000564c8bd85fa5 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+0x4667fa5)
#27 0x0000564c8bcd3d15 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+0x45b5d15)
#28 0x0000564c8bcd3fbf mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b5fbf)
#29 0x0000564c8bcd42ee mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b62ee)
#30 0x0000564c88884a77 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1166a77)
#31 0x00007f16ea670083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#32 0x0000564c888845ee _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11665ee)
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:arith