Issue 203857
Summary [mlir] -test-legalize-unknown-root-patterns
Labels mlir
Assignees
Reporter Anonymous7i0em3yd
    git version: 58031e519153fdbe637f9f135ac1fbfef6f0e224

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -test-legalize-unknown-root-patterns a.mlir`

a.mlir:  

```mlir
module {
  spirv.func @nofold_collapse_with_non_fusion_mini_loop(%arg0: i32, %arg1: i32, %arg2: i32) -> i32 "None" attributes {llvm.emit_c_interface} {
    %0:2 = "test.op_with_region_or_terminator_op"(%arg0, %arg1, %arg2) : (i32, i32, i32) -> (i32, i32)
    %1 = builtin.unrealized_conversion_cast %0#1 : i32 to i32
    spirv.ReturnValue %1 : i32
  }
}

```

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 -test-legalize-unknown-root-patterns 12.mlir
 #0 0x00005580ed3a7798 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff4798)
 #1 0x00005580ed3a4631 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff1631)
 #2 0x00005580ed3a88b6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f32d135a420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00005580f247977f mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<mlir::spirv::FuncOp::verifyBody()::$_0>(long, mlir::Operation*) SPIRVOps.cpp:0:0
 #5 0x00005580ed46be67 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b8e67)
 #6 0x00005580f2470e84 mlir::spirv::FuncOp::verifyBody() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x70bde84)
 #7 0x00005580f1ef4222 llvm::LogicalResult mlir::function_interface_impl::verifyTrait<mlir::spirv::FuncOp>(mlir::spirv::FuncOp) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6b41222)
 #8 0x00005580f1ef3908 mlir::Op<mlir::spirv::FuncOp, mlir::OpTrait::OneRegion, mlir::OpTrait::ZeroResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::ZeroOperands, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpTrait::AutomaticAllocationScope, mlir::SymbolOpInterface::Trait, mlir::ArgAndResultAttrsOpInterface::Trait, mlir::CallableOpInterface::Trait, mlir::FunctionOpInterface::Trait, mlir::OpTrait::IsIsolatedFromAbove, mlir::detail::Interface<mlir::spirv::QueryMinVersionInterface, mlir::Operation*, mlir::spirv::detail::QueryMinVersionInterfaceTraits, mlir::Op<mlir::spirv::QueryMinVersionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryMaxVersionInterface, mlir::Operation*, mlir::spirv::detail::QueryMaxVersionInterfaceTraits, mlir::Op<mlir::spirv::QueryMaxVersionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryExtensionInterface, mlir::Operation*, mlir::spirv::detail::QueryExtensionInterfaceTraits, mlir::Op<mlir::spirv::QueryExtensionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryCapabilityInterface, mlir::Operation*, mlir::spirv::detail::QueryCapabilityInterfaceTraits, mlir::Op<mlir::spirv::QueryCapabilityInterface>, mlir::OpTrait::TraitBase>::Trait>::verifyInvariants(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6b40908)
 #9 0x00005580f1eef87e mlir::RegisteredOperationName::Model<mlir::spirv::FuncOp>::verifyInvariants(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6b3c87e)
#10 0x00005580f60a6960 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#11 0x00005580f60a64e0 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#12 0x00005580f60a57af mlir::verify(mlir::Operation*, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xacf27af)
#13 0x00005580f5d63f12 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b0f12)
#14 0x00005580f5d64a64 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)
#15 0x00005580f5d6b97a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b897a)
#16 0x00005580f5d6b2af mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa9b82af)
#17 0x00005580ed458940 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#18 0x00005580ed457b76 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
#19 0x00005580f60b8ca5 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)
#20 0x00005580ed44d776 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)
#21 0x00005580ed44db55 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209ab55)
#22 0x00005580ed44deb5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209aeb5)
#23 0x00005580ed38d222 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fda222)
#24 0x00007f32d0978083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#25 0x00005580ed38cd5e _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