<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109649>109649</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] -mlprogram-pipeline-globals crashes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
axeabc
</td>
</tr>
</table>
<pre>
git version: c3d3cef8d5837
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)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWE1v47wR_jX0hYhAkfo8-OBN4naBBAmSLXo0KHEoq6EolaR2k_76gpL8ISfOdot1X_QFEsnSDIfPMzOcocitrSsNsETxFxTfLHjvtq1Z8lfgRbkoWvG2rGqHv4OxdasRW-GSCVaCzEScsRSRG0RW49W-WQeNV0EJ-VvRa9fjMAtIFCT47tszSsixtoHOtKIvAf-o3XYa1ajaXLWdw1eN6kxbGd5cdXUHqtZwVam24MpiHni1E3PjdRKx3cuEjH94fJa9LgN_wSgiJVdqw7XYWNca2HDpwCCaIRpzU4UeUAONAYnYtWQUsVtEc4zSL6MpPEkD1XKBd4MGH3olzRvAiN1gRKmfyJumKL3BH9mdDDqwLpij2uEEOEJGc0Svd1N-NJmfil7jk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