Issue 203860
Summary [mlir] -convert-func-to-llvm=index-bitwidth=32 bug report
Labels mlir
Assignees
Reporter Anonymous7i0em3yd
    git version: 58031e519153fdbe637f9f135ac1fbfef6f0e224

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -convert-func-to-llvm=index-bitwidth=32 a.mlir`

a.mlir:  

```mlir
module {
  func.func @parallel_loop_bidy(%arg0: index, %arg1: index, %arg2: index, %arg3: index) {
    %0 = affine.for %arg4 = 0 to 101 iter_args(%arg5 = %arg1) -> (index) {
      affine.yield %arg3 : index
    }
    return
 }
}

```

stack trace:

```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -convert-func-to-llvm=index-bitwidth=32 15.mlir
 #0 0x0000556062722798 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff4798)
 #1 0x000055606271f631 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff1631)
 #2 0x00005560627238b6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f91bbac1420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000055606ac6e254 mlir::affine::AffineForOp::fold(mlir::affine::AffineForOpGenericAdaptor<llvm::ArrayRef<mlir::Attribute>>, llvm::SmallVectorImpl<mlir::OpFoldResult>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa540254)
 #5 0x000055606acbc2ca llvm::LogicalResult mlir::Op<mlir::affine::AffineForOp, mlir::OpTrait::OneRegion, mlir::OpTrait::VariadicResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::VariadicOperands, mlir::OpTrait::AttrSizedOperandSegments, mlir::OpTrait::SingleBlock, mlir::OpTrait::SingleBlockImplicitTerminator<mlir::affine::AffineYieldOp>::Impl, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpTrait::AutomaticAllocationScope, mlir::ConditionallySpeculatable::Trait, mlir::OpTrait::HasRecursiveMemoryEffects, mlir::LoopLikeOpInterface::Trait, mlir::RegionBranchOpInterface::Trait>::foldHook<mlir::affine::AffineForOp>(mlir::Operation*, llvm::ArrayRef<mlir::Attribute>, llvm::SmallVectorImpl<mlir::OpFoldResult>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa58e2ca)
 #6 0x000055606acb8dd0 mlir::RegisteredOperationName::Model<mlir::affine::AffineForOp>::foldHook(mlir::Operation*, llvm::ArrayRef<mlir::Attribute>, llvm::SmallVectorImpl<mlir::OpFoldResult>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa58add0)
 #7 0x000055606b3f459f mlir::Operation::fold(llvm::ArrayRef<mlir::Attribute>, llvm::SmallVectorImpl<mlir::OpFoldResult>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xacc659f)
 #8 0x000055606b3f4916 mlir::Operation::fold(llvm::SmallVectorImpl<mlir::OpFoldResult>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xacc6916)
 #9 0x000055606b334c3e mlir::OpBuilder::tryFold(mlir::Operation*, llvm::SmallVectorImpl<mlir::Value>&, llvm::SmallVectorImpl<mlir::Operation*>*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xac06c3e)
#10 0x000055606b0412d5 (anonymous namespace)::OperationLegalizer::legalizeWithFold(mlir::Operation*) DialectConversion.cpp:0:0
#11 0x000055606b036d49 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*) DialectConversion.cpp:0:0
#12 0x000055606b03671c mlir::OperationConverter::convert(mlir::Operation*, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90871c)
#13 0x000055606b037a80 mlir::OperationConverter::applyConversion(llvm::ArrayRef<mlir::Operation*>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa909a80)
#14 0x000055606b045d69 void llvm::function_ref<void ()>::callback_fn<applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode)::$_0>(long) DialectConversion.cpp:0:0
#15 0x000055606b03ce97 applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode) DialectConversion.cpp:0:0
#16 0x000055606b03cf7b mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90ef7b)
#17 0x0000556067848592 (anonymous namespace)::ConvertFuncToLLVMPass::runOnOperation() FuncToLLVM.cpp:0:0
#18 0x000055606b0dec22 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b0c22)
#19 0x000055606b0dfa64 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+0xa9b1a64)
#20 0x000055606b0e697a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b897a)
#21 0x000055606b0e62af mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b82af)
#22 0x00005560627d3940 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x00005560627d2b76 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#24 0x000055606b433ca5 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad05ca5)
#25 0x00005560627c8776 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+0x209a776)
#26 0x00005560627c8b55 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209ab55)
#27 0x00005560627c8eb5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209aeb5)
#28 0x0000556062708222 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fda222)
#29 0x00007f91bb0df083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x0000556062707d5e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fd9d5e)
Segmentation fault (core dumped)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to