<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54178>54178</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] Marking analysis retained external to pass
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir:core
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jpienaar
</td>
</tr>
</table>
<pre>
Currently there doesn't seem to be a way to mark an analysis as retained except by a pass author. That means if I'm an Analysis author I cannot mark an Analysis as retained for passes which I know it won't be affected/will be retained by but require the pass knows about the analysis and marks it retained. I know this is semi WAI as the set retained is a guarantee by pass author as currently written. But for cases where it is indirect, this results in conservative invalidations which cannot be avoided (e.g., canonicalization requires not changing type/inserting casts as needed, analysis Foo is valid while types are unchanged and so can depend on the invariant provided by canonicalization, but Analysis cannot be retained today unless we mark it in the pass itself - in this case an alternative could be a query method "is valid while: type_unchanged" and canonicalization could have "invariant: type_unchanged" and using these "traits" one could determine it was retained even without Foo being known to pass author; this shifts knowledge of these "traits"/invariants to pass and analysis authors in decoupling).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VE1v2zAM_TXOhajh2E3jHHxIWwToYbcBOw6SRdtqZSmV5GTZrx8pNx_dOsBIYol8fO-RjHTq1DxN3qON5gRxQI-gHAablesIAXGE6EAiCDiKE_8ehX8DYekR5hR0ABHAYxTaogL81eI-gjxR_F4Eupzi4HwO3wcRYURhA-gOXgh9ZJDtBSTFwQu0wloXL1W2X1XpKJLRMcBx0O1AaW_WHUFHOLqZOTPuOmwjqqzcHbUxfHRBIIJyivT-PmlSTLpnugxDtaSjSz68irQqcQpc5AyTnwvHgULoCThq-LF9YbacHvAazPcC-kl4YSMiU7hxiDPaSx-OXseINodH4sFqWzGL5fYQAa5mFTFvY1Y-zeU9hslEvoDW2YD-IKI-ULg9CKMVvdDph18fJrNJB6cVkcvKGvM-ZzS6dFa3lPQ7JZ1dCsA57SBsr20P8bRHslZzqcgHxDGmPllExbY_Xe3bOcekExPmYDDlUzgJmmwCJRbscnDMABTukd6oPBvJIrwm42Dv3SExJv_-Zsolua2XobnqvHQhOkVzPFmD5P0R50FjS-11CnQMaDq4mw8TTsA08yait7OvrZuMmjfjfUJ_oummRrKT5WelWbVNYn9edFJIkvqP0zPmIAieYc6i_48whdSKAUPKiF4Qd7509sxQIXEeSXtaj0_LekALR02syTPukERG44m2vOk345lVj7MTYdBdnPfEoOoRXPdF-TQXH-TDFcqqm4VKuGlcFRLTvaHaWbnJF6qp1KbaiEXU0WCTrR5Ho322eoZv1CtmeAG5-d9JjTHnWovJm2aIcR_IO2JDT09CJ5m3bqQXYw7nrzuaqNe0SDsdwoTEf7e6X67rxdA8yOW9rMq6XK6Lqiq6dSfXUi7retmWVf0gF0ZINIE5kupEs9q2ziN7sHpe6KYsyrKoimpZ08cmX8v6od7Iolivy01RtNl9gaPQJmcmufP9wjeJlJz6QJdG005dL0mZ7mm9UkHCn01sXvcarRB-kQQ0if0fSNwR5w">