<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63146>63146</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR] Stack overflow with deeply nested regions in verifier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
uenoku
</td>
</tr>
</table>
<pre>
In use cases in CIRCT (https://github.com/llvm/circt/issues/5316), we encountered stack overflow in `verify` (or parser if we use MLIR textual format) for deeply nested regions (like O(10000)) to represent long if-else chains. We are trying avoiding insanely deep regions but it would be nice if verifier doesn't crash. (We are aware that the developer policy allows recursion within regions (as mentioned in https://mlir.llvm.org/getting_started/DeveloperGuide/#style-guide), and there has been a discussion regarding this matter at https://discourse.llvm.org/t/rfc-update-to-mlir-developer-policy-on-recursion/62235 so please free to close the issue if using recursion in verifier is unavoidable).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEk82K_DYQxJ9GvjQeZHns9Rx8SHaZsJAQ-CeQY5CtHruzGsmoWzuZtw_yJvsRCDlZGFr9qyqVZaYlII6q-151T5XNssY0ZgzxJVdTdPfxOUBmhNkyMlCAx-dvj7-CMsMqsrFqv1PmrMx5IVnzdJjjVZmz96_lM1OaRZkzMWdkZc5d2_TKnJR5hBsChjnmIJjQAYudXyC-Yrr4eCt7VK9fMdHlrnpd1sUEm02MCehSpgvUTz8-fwPBPyVbD5eYrlaUOZUTOMTN3yEgCzpIuFAMXO7x9ILwszJDo7XWO80JJELCLSFjEPAxLECXGn3RvVoKfIDfEGxCkHSnsIB9jeTKgQLbgP6-73tfM2UBErjF7B1MCIFmLNi7IMIELiIHZR4E5mR5PRSwvzfY275ntQKyIjh8RR83TLBFT_MdrPfxxpBwzokpBriRrBQ-S7QMVwxCMaArVn5N6uopHUpCh5iWkhyKUFh-Z7FJ0Clzfvpn5w-ZHO5TLcvdY728_dgTtMEVwoSwWoYJMYAFRzxn3rkSLjbtJslKDFcrggms_AunTMScGD8zlVeTLnOdN2cFa4l1oa7fzajfzKhjqN-NUObcG9N2wBE2j5YRLgmxZDv7yLjbuT_FEkXmQvbhIoWPdIghhz1iO_ki9wCVG1t3ak-2wrHph153gx5MtY4Pk2nmobmcHpzpjrrV2HZHN3Rm6HRzNH1Fo9Gm1b3um9YM2hwa7bDVFueumWz7YNVR49WSf9df7ZBj3zbHvvJ2Qs97P40JeHtToIwpdU1jmamnvLA6ak8s_HGLkPi92KUlqnuCX752rLyb_6jJJzOqnPz4_1XfObYU_8Cvjd9F_BUAAP__yFd9ig">