<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64267>64267</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] `one-shot-bufferize` crashed with assertion failure "invalid combination of bufferization flags"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Colloportus0
      </td>
    </tr>
</table>

<pre>
    MLIR built at commit  b4c54b20
Reproduced with:  
`mlir-opt "--one-shot-bufferize= copy-before-write test-analysis-only" temp.mlir`, where `temp.mlir` is an empty file
 
trace: 
```console
Assertion failed: (!(options.copyBeforeWrite && options.testAnalysisOnly) && "invalid combination of bufferization flags"), function runOneShotBufferize, file OneShotAnalysis.cpp, line 1136.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: mlir-opt "--one-shot-bufferize=allow-unknown-ops  copy-before-write test-analysis-only" temp.mlir
 #0 0x0000000101284548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8548)
 #1 0x00000001012827e4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f67e4)
 #2 0x0000000101284bf4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f8bf4)
 #3 0x00000001a46cd4c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
 #4 0x00000001a46b5ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
 #5 0x00000001a45f0340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
 #6 0x00000001a45ef754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
 #7 0x000000010515a59c wouldCreateReadAfterWriteInterference(mlir::OpOperand&, mlir::DominanceInfo const&, mlir::bufferization::OneShotAnalysisState&, bool) (.cold.1) (/workspace/build/bin/mlir-opt+0x1041ce59c)
 #8 0x000000010163cf8c mlir::bufferization::OneShotAnalysisState::~OneShotAnalysisState() (/workspace/build/bin/mlir-opt+0x1006b0f8c)
 #9 0x000000010161c8dc (anonymous namespace)::OneShotBufferizePass::runOnOperation() (/workspace/build/bin/mlir-opt+0x1006908dc)
#10 0x000000010390de34 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102981e34)
#11 0x000000010390e524 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102982524)
#12 0x00000001039103bc mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1029843bc)
#13 0x0000000103908808 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10297c808)
#14 0x0000000103907d30 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x10297bd30)
#15 0x0000000103986be0 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/workspace/build/bin/mlir-opt+0x1029fabe0)
#16 0x00000001039026e4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x1029766e4)
#17 0x0000000103902b54 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102976b54)
#18 0x0000000100f8f58c main (/workspace/build/bin/mlir-opt+0x10000358c)
#19 0x000000010c5f9088 

``` 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWEFvIjsS_jXmYoHcdnfTHDgwJGhHmihR8qQ9Rm67Grxj7F7b_Rj2sL99ZQMJJsm8CVrtPr0ICUK5XV99_qpcFPderQ3AHFVfUHUz4kPYWDdfWq1tb10YPBm1Vu7nd9--PuJ2UDpgHrCw260KGLelqMqWEkRuEFk8Qu-sHARIvFNhg9gC44MF1WSrlRvbPmBE6XhsDYz9xoZxO3QdOPUvQOwGC9vvxy101sF451QAHMCHMTdc773yY2v0HlGKA2z7SdwQ1QTRJd5twAFGNTk3YOUxNxi2fdjjTmk4QDkiCo4LiAhfAB5ewhpvT2sX3oMLyhrccaVBpvW0QbRAtLF9tPhJBP0lYf57goxojWiNT-YYweIYwH3CPzstQZQq8zvXSkZCW2V48mU7fGLl8EWn-dojShGdxWi7wYj0vRvMvYGnjQ1fXliMdqUBHw0nzxPR99GmlQFcFKyeHCJ8-Ha7eLrFfmjjeXLcDmvsIJ48DhZvQug9YgtEV4iu1ipshnYi7BbRlda_n97GvbP_ABEQXSnvB_CIrjA3Eisj9CABhw1g4bjf4JaL74n5o_unwMV3LIdtH72kr8gEkdmDs2vHt5i79bAFEyII_AsK4lrb3Xgw343dmbHtPb5CU0eZUEYw-UEOfwUpaFNWZ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