Skip to content

[mlir] -mlprogram-pipeline-globals crashes #109649

@axeabc

Description

@axeabc

git version: c3d3cef

system: Ubuntu 18.04.6 LTS

reproduce with: mlir-opt -mlprogram-pipeline-globals a.mlir

a.mlir:

func.func @call_and_store_after(%arg1: memref<f32>) {
  memref.load %arg1[] {name = "caller"} : memref<f32>
  test.call_and_store @callee(%arg1), %arg1 {name = "call", store_before_call = false} : (memref<f32>, memref<f32>) -> ()
  memref.load %arg1[] {name = "post"} : memref<f32>
  return
}

stack trace:

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 -mlprogram-pipeline-globals a.mlir
 #0 0x000055a1d0e12458 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1100458)
 #1 0x000055a1d0e0ff6e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10fdf6e)
 #2 0x000055a1d0e12ded SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f2dfafdf420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000055a1d41699d0 mlir::ForwardIterator::makeIterable(mlir::Operation&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x44579d0)
 #5 0x000055a1d0f16a02 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1204a02)
 #6 0x000055a1d26ab1ea mlir::ml_program::(anonymous namespace)::MLProgramPipelineGlobals::runOnOperation() PipelineGlobalOps.cpp:0:0
 #7 0x000055a1d3fa28e6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x42908e6)
 #8 0x000055a1d3fa3250 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+0x4291250)
 #9 0x000055a1d3fa57f2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x42937f2)
#10 0x000055a1d3f9e0d1 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#11 0x000055a1d3f9dd2b 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
#12 0x000055a1d40494e5 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+0x43374e5)
#13 0x000055a1d3f99155 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+0x4287155)
#14 0x000055a1d3f993ff mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x42873ff)
#15 0x000055a1d3f9972e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x428772e)
#16 0x000055a1d0df2fe7 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10e0fe7)
#17 0x00007f2dfa5fd083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#18 0x000055a1d0df2b6e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10e0b6e)


Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]mlir

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions