<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVU1v2zAM_TXOhZjhjyWtDz6k6YbtsK3YCuwYyBYda5UlQ5LTZr9-pBKnn7tsgWBZMvX4SD4qjZWHejM5hyboA9wj9GKPEHrlobUSQRla8KSVQZcUG7jvVduDRxw8BAsNRgNr-Lg48NYg7hAEyIMRg2phFN6DVncn2E4FwD26A63Mjux3SAAuKddJdp1k83OVnUZcAv2S4iMNuFEjMhkPwiHgw4htQHmiYrvIprNuAD5cbuz4jmhgUn5Iiktaj6fjcaMim_TRg1e_cRtgNvkRhAuQlNfnnbRTRm475XzY2o4Bi4v5WSXl1SOU6ojv5SskBvsRHAX-HTsOuVyb0XpILjY06Eh-dtVa46cBt41o76KPgn2cntWjJwCHYXIGOqH05DDaPidz9gh2_ErJeB5ToHJtO2dNeMn4Jc638YZq-UUYsUMH40D2R8C3o2dCKBlUOI98dK7dE0epdHY8u8_p3BW8IkGyY2_VP8Q-Y_k0uMMWh1GLFp8Q34AP8liJwe4js9nTDPNCi8fnLWuZxmRIbGEyIiAJsBWTR1be65BXGZsbG6g1BuWcdaxW2n6W1SOTkeoV1v4WH8Ik9FMI4qdSTFnlpP4IOLedVI5agdqQJofMR5gXJaM0D0D9d69Cb6cA0sYW5FC8Vi0v-ii3KoWfCJ6MtARUbzVosYZPfFcI2AunhAmncN6M_HhpsNJ8bFB8EG04tmmMlRq4OcTTf41cGHmqtufAXiXuXB4idouC3fG9NAZlDfiDDzhAb-85UyNJDh1nyk5GUnOMFAVJhGm8gbuQdSmrshILMVHeXE2GWgsn2lZJujgXk9N1H8LoOUfxltpRyqaGepi09FHr_Ty9I9e_qEq0VN5P6OllSbIvF33drLDFZlU1-aorltmyW2aS3jHrsOneZ9lCiwa1r5PlFV0Dg1Zcktay6otkeb34fw6qLrIiz4sip2mVVWmeV6K5uMSVuMxXbdUl7zMcqNVSxkmt2y1cHSGbaefpo1Y--MePlEW1M4iRMjEMKmisrzAE0uKpB9Y3nyn1KCn1JAdg9URNHgVw_POYe3gR-daR7B9bESww>52813</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Better mirror API needed for parsing textual pass pipeline
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir:core
      </td>
    </tr>

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

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

<pre>
    Currently we have this code in the inliner, which seems to be the only way to make a dynamic pass like this fit everything together:

```
    // Pipelines are expected to be of the form `<op-name>(<pipeline>)`.
    size_t pipelineStart = pipeline.find_first_of('(');
    if (pipelineStart == StringRef::npos || !pipeline.consume_back(")"))
      return failure();
    StringRef opName = pipeline.take_front(pipelineStart);
    OpPassManager pm(opName);
    if (failed(parsePassPipeline(pipeline.drop_front(1 + pipelineStart), pm)))
      return failure();
    pipelines.try_emplace(opName, std::move(pm));
```

This is unfortunate because `parsePassPipeline` is not a mirror of `OpPassManager::printAsTextualPipeline` (i.e. there is no way to directly recreate an OpPassManager from it without doing this slicing hack). We should either:

* Have a variant of `parsePassPipeline` which takes the exact form printed by `printAsTextualPipeline` and returns an `OpPassManager`
* Teach the option system how to properly roundtrip a nested `OpPassManager`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVU1v2zAM_TXOhagR220SH3xI0xXbYVuxFdgxoC061ipLhiSnzX79KCVOP3dZYMiRwo_3yEelNuJQbUZrSXt1gEeCDvcEvpMOGiMIpOZNeCmpySb5Bh472XTgiHoH3kBN0cDo4I6HcNTjAwGCOGjsZQMDOgdKPpzCttID7ckeeKd3bL8jDmCTYp3Mb5L5tC7mpydugT9JfssP3MmBAhgHaAnoaaDGkzhBMW1E0xrbQ3AuNma4YBiUFJ-SfMX74eQeD0q2SZ8zOPmHth4mk58erYekuDmfpK3UYttK6_zWtCFgvpzWMimun0PJlvGu3kUKwX56y8R_UBsoF2s9GA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