| Issue |
74234
|
| Summary |
[mlir] --int-range-optimizations crashed with assertion failure "Bit widths must be same for comparison".
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
anonymousMCS
|
git version: e9c6f3f5e7e23b23de4eeaa182ebfcb7d2188495
system: ```Ubuntu 20.04.6 LTS (Focal Fossa)```
reproduced with: ```mlir-opt --int-range-optimizations a.mlir```
a.mlir:
```
func.func private @func1() -> index {
%c30 = arith.constant 30 : index
%2 = builtin.unrealized_conversion_cast %c30 : index to i32
llvm.return %2 : i32
}
llvm.func @func2() {
%c0 = arith.constant 0 : index
%52 = func.call @func1() : () -> index
%62 = index.maxu %c0, %52
llvm.return
}
```
trace:
```
mlir-opt: /data/bin/llvm-project/llvm/lib/Support/APInt.cpp:283: int llvm::APInt::compare(const llvm::APInt&) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' 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 --int-range-optimizations a.mlir
#0 0x000055932184ee8f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/bin/llvm-project/build/bin/mlir-opt+0x1640e8f)
#1 0x000055932184bee4 SignalHandler(int) Signals.cpp:0:0
#2 0x00007f45bb0e3420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007f45babce00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007f45babad859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x00007f45babad729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#6 0x00007f45babbefd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#7 0x00005593218d9d74 (/data/bin/llvm-project/build/bin/mlir-opt+0x16cbd74)
#8 0x00005593267670b3 mlir::intrange::inferMaxU(llvm::ArrayRef<mlir::ConstantIntRanges>) (/data/bin/llvm-project/build/bin/mlir-opt+0x65590b3)
#9 0x00005593220432ac mlir::ConstantIntRanges llvm::function_ref<mlir::ConstantIntRanges (llvm::ArrayRef<mlir::ConstantIntRanges>)>::callback_fn<mlir::ConstantIntRanges (llvm::ArrayRef<mlir::ConstantIntRanges>)>(long, llvm::ArrayRef<mlir::ConstantIntRanges>) (/data/bin/llvm-project/build/bin/mlir-opt+0x1e352ac)
#10 0x0000559326763b1a mlir::intrange::inferIndexOp(llvm::function_ref<mlir::ConstantIntRanges (llvm::ArrayRef<mlir::ConstantIntRanges>)>, llvm::ArrayRef<mlir::ConstantIntRanges>, mlir::intrange::CmpMode) (/data/bin/llvm-project/build/bin/mlir-opt+0x6555b1a)
#11 0x00005593220442dc mlir::index::MaxUOp::inferResultRanges(llvm::ArrayRef<mlir::ConstantIntRanges>, llvm::function_ref<void (mlir::Value, mlir::ConstantIntRanges const&)>) (/data/bin/llvm-project/build/bin/mlir-opt+0x1e362dc)
#12 0x000055932200992d mlir::detail::InferIntRangeInterfaceInterfaceTraits::Model<mlir::index::MaxUOp>::inferResultRanges(mlir::detail::InferIntRangeInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::ConstantIntRanges>, llvm::function_ref<void (mlir::Value, mlir::ConstantIntRanges const&)>) (/data/bin/llvm-project/build/bin/mlir-opt+0x1dfb92d)
#13 0x000055932449d811 mlir::dataflow::IntegerRangeAnalysis::visitOperation(mlir::Operation*, llvm::ArrayRef<mlir::dataflow::IntegerValueRangeLattice const*>, llvm::ArrayRef<mlir::dataflow::IntegerValueRangeLattice*>) (/data/bin/llvm-project/build/bin/mlir-opt+0x428f811)
#14 0x00005593244a7bc5 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::visitOperation(mlir::Operation*) (/data/bin/llvm-project/build/bin/mlir-opt+0x4299bc5)
#15 0x00005593244a7edb mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::visit(mlir::ProgramPoint) (/data/bin/llvm-project/build/bin/mlir-opt+0x4299edb)
#16 0x000055932445861d mlir::DataFlowSolver::initializeAndRun(mlir::Operation*) (/data/bin/llvm-project/build/bin/mlir-opt+0x424a61d)
#17 0x0000559321b8b6cd (anonymous namespace)::IntRangeOptimizationsPass::runOnOperation() IntRangeOptimizations.cpp:0:0
#18 0x00005593244c285e mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/bin/llvm-project/build/bin/mlir-opt+0x42b485e)
#19 0x00005593244c2d3a 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+0x42b4d3a)
#20 0x00005593244c3564 mlir::PassManager::run(mlir::Operation*) (/data/bin/llvm-project/build/bin/mlir-opt+0x42b5564)
#21 0x00005593244b42d3 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#22 0x00005593244b57a4 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
#23 0x00005593244b5954 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
#24 0x00005593245b4c44 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+0x43a6c44)
#25 0x00005593244ae1b7 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+0x42a01b7)
#26 0x00005593244b5aa1 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x42a7aa1)
#27 0x00005593244b5f06 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x42a7f06)
#28 0x000055932178650b main (/data/bin/llvm-project/build/bin/mlir-opt+0x157850b)
#29 0x00007f45babaf083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#30 0x000055932181f1ee _start (/data/bin/llvm-project/build/bin/mlir-opt+0x16111ee)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs