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

    <tr>
        <th>Summary</th>
        <td>
            mlir::Inliner textual representation doesn't canonicalize
        </td>
    </tr>

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

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

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

<pre>
    The [mlir::createInlinerPass()](https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/Inliner.cpp#L824) by default creates a pipline that always runs [canonicalization](https://source.corp.google.com/piper///depot/google3/third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp;l=39?q=inliner.cpp). When this pass is dumped to text for MLIR reproduction, it is output as such:

`inline{default-pipeline= max-iterations=4 }`

When the pass is recreated with [MLIROptMain](https://github.com/llvm/llvm-project/blob/main/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp), the Canonicalizer is not run, so there's a slight difference in how the pass works when created with dumped pipelines versus what happens when the pipeline is created programatically.

Example program is attached:
[inliner.txt](https://github.com/llvm/llvm-project/files/10818693/inliner.txt)

This seems to be happening because the [defaultPipeline](https://source.corp.google.com/piper///depot/google3/third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp;l=810?q=inliner.cpp) gets erased when the flag `default-pipeline` exists, but the `default-pipeline` doesn't dump `canonicalize`, but I could be way off :). Thanks!

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVU-PozYU_zTO5WkisIHAgcPOpkgr7airaqQeKwMPcNfYrm02k3766hFoUnUqtVUPvSQS_Hj-_bMtQ1CjQaxZ_szy80EucbK-7iZpxvnQ2v5av04ILH-etfJMfGDiQ-dRRvxktDLov8gQGC8Zr1h-ZrycYnSBcLxhvBlVnJb22NmZ8Ubrb_vfk_P2Z-wi402rbct4M0tl6I9W4Y1W9OzVSxMG6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