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

    <tr>
        <th>Summary</th>
        <td>
            MLIR tests failing under Release
        </td>
    </tr>

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

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

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

<pre>
    Hi all,

when building LLVM in release mode, enabling `mlir`, like so

```
cmake -G Ninja <llvm-source-path> -DCMAKE_BUILD_TYPE=Release \
 '-DLLVM_ENABLE_PROJECTS=clang;mlir' \
   -DLLVM_USE_LINKER=lld \
 -DLLVM_ENABLE_LIBCXX=ON
```

Then I see the following failures on `check-mlir`.

```
Failed Tests (3):
  MLIR :: Dialect/LLVMIR/sroa-statistics.mlir
  MLIR :: Dialect/MemRef/mem2reg-statistics.mlir
  MLIR :: Dialect/Transform/test-repro-dump.mlir
```

(libc++ and lld may not be necessary when building but I'm consistently able to trigger the errors under that build configuration)

System is an x86-64 Ubuntu 22.04 LTS building with clang 15.0.6 from llvm.org

I've investigated a bit, the tests does not crash but does not print what it is expected from it.

>From what I saw in the debugger, the switch in https://github.com/llvm/llvm-project/blob/main/mlir/lib/Pass/PassStatistics.cpp#L152 even if it covers all the cases of the `enum class PassDisplayMode` ( https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Pass/PassManager.h#L195 ) is never executed.

At firstg it seems a miscompilation triggered by building in Release mode (a lot of things get inlined) but I have not found anything obvious.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVd-P2jgQ_mvMywgUHBLggQd-3nGFbcXSU-9p5TiTZFrHRrYDy39_smFvWamqVOkkhOWxZ_zNN99MhHNUa8QZyxYsW_VE5xtjZ9ZUZC21vcKU19mfBEIpxpcsWbFkfvu_NKih6EiVpGvY7f7eA2mwqFA4hNaUyPgSUItChQssT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