Issue 120943
Summary [mlir] -int-range-optimizations crashes
Labels
Assignees
Reporter wwy6191
    git version: bc29fc937c6cb4a210f80c93c79fc6ed97c801f8

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt  -int-range-optimizations a.mlir`


a.mlir:  
``` 
func.func @test() -> i1 {
  %cst1_i1 = arith.constant 0 : i1
  %0= test.with_bounds { umin = 0 : i64, umax = 12 : i64, smin = 0 : i64, smax = 12 : i64} : i1
  %1= arith.cmpi sgt, %0, %cst1_i1 : i1
  %2= arith.cmpi slt, %0, %cst1_i1 : i1
  %3 = arith.andi %1, %2 : i1
  return %3 : i1
}

``` 
stack trace:

``` 
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/llvm/lib/Support/APInt.cpp:293: int llvm::APInt::compareSigned(const 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/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -int-range-optimizations /data/szy/MLIR/seed/seed29/tmp.twXBPBsQjz.mlir
 #0 0x0000562d78de6508 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11ef508)
 #1 0x0000562d78de401e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11ed01e)
 #2 0x0000562d78de6e9d SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fb44a5a7420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fb449be400b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007fb449bc3859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007fb449bc3729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007fb449bc3729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007fb449bd4fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x0000562d78e5d893 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1266893)
#10 0x0000562d7e46089d isStaticallyTrue(mlir::intrange::CmpPredicate, mlir::ConstantIntRanges const&, mlir::ConstantIntRanges const&) InferIntRangeCommon.cpp:0:0
#11 0x0000562d7e4607a3 mlir::intrange::evaluatePred(mlir::intrange::CmpPredicate, mlir::ConstantIntRanges const&, mlir::ConstantIntRanges const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x68697a3)
#12 0x0000562d790dcf95 mlir::arith::CmpIOp::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+0x14e5f95)
#13 0x0000562d7908ca81 mlir::detail::InferIntRangeInterfaceInterfaceTraits::Model<mlir::arith::CmpIOp>::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+0x1495a81)
#14 0x0000562d7ef24016 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+0x732d016)
#15 0x0000562d7bd31d3c 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+0x413ad3c)
#16 0x0000562d7bd34df9 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::visitOperation(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x413ddf9)
#17 0x0000562d7bd34499 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x413d499)
#18 0x0000562d7bd3474d mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x413d74d)
#19 0x0000562d7bd3474d mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x413d74d)
#20 0x0000562d7bd12b4e mlir::DataFlowSolver::initializeAndRun(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x411bb4e)
#21 0x0000562d7911917d (anonymous namespace)::IntRangeOptimizationsPass::runOnOperation() IntRangeOptimizations.cpp:0:0
#22 0x0000562d7bd47ec6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4150ec6)
#23 0x0000562d7bd487f0 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+0x41517f0)
#24 0x0000562d7bd4adc2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4153dc2)
#25 0x0000562d7bd4353a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#26 0x0000562d7bd4318d 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
#27 0x0000562d7bdeec65 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+0x41f7c65)
#28 0x0000562d7bd3d175 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+0x4146175)
#29 0x0000562d7bd3d41f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x414641f)
#30 0x0000562d7bd3d74e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x414674e)
#31 0x0000562d78dc6ff7 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11cfff7)
#32 0x00007fb449bc5083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#33 0x0000562d78dc6b6e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11cfb6e)
``` 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to