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

    <tr>
        <th>Summary</th>
        <td>
            [MLIR][Presburger] Expensive check in assert mode - hasConsistentState
        </td>
    </tr>

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

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

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

<pre>
    This seems to be  prohibitively expensive to justify even in assert mode: https://github.com/llvm/llvm-project/blob/3c560dd0ae676e28a2560b1041c9411908e999a5/mlir/lib/Analysis/Presburger/Matrix.cpp#L370

Is this really needed? One wouldn't expect entire parts of a buffer checked in an assert that would have otherwise been O(1). It significantly slows down Release assert build (a common configuration) and would be dominant in nearly anything that is heavy on affine analysis.

CC: @Groverkss
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk81urDgQhZ_GbEq3ZWx-mgWLvulhFOlGGWXmBcq4ACfGbtmmO7z9CDrJRLO7G1iUfFznnM8YoxkdUcvKn6w8Z7ikyYdWeaenZVwsZsrrtf1nMhEi0RwheVAEcAl-MsokcyW7Ar1fyEVzpW38usRkhhXoSg6MA4yRQoLZa2LyBFNKl8jkiYmOiW40aVrUofczE52118_fj0vwr9QnJjplvWKik31Zca05UlVXJI4oyoqrnBd53xR53vAjNU2DJRPdbE3YdMx27uTQrtFEJrq_AkW1hJG26ROmYN4P_eXChPwla874mfHT_fsYIW2eA6G1KzgiTZrJDp4dwc0vVjsm6rQb7xOQSyYQXDCkCH4ABLUMAwXoJ-rfSO8xfCWRJkx3EZjwSuDTROFmIoEicvDMxDFnojnAY4KtHjOYHl2yK0TrbxG0vzl4IUsY6VNTLcZqYOKI0Pt59g567wYzLgGT8Y6JBtDpj1sVgfazcejStpkjDHYFdGuajBvv-5kIE-F1Be8Ah8E4AvxI8vA9qYeHrVRW8D-Dv1J4izHTrdSNbDCjNq_qQjaNFHU2tVIMhVBVJXNxJBqaPq-ExLqvdVE3Jc8z0wouJM-FyIuyFPWhLusmH45K9BK5lMgKTjMae9gQOfgwZibGhdqKC15nFhXZuKMsxM6APN1XZ0JsdId2R0stY2QFtyam-J9SMsnu7-Dp1-MLK8-s_PmNl_IMf3xBvrf6P7ThB0wYH7yLJiZy6e-EibIl2Pa3gd89bbzutv4NAAD__6rPM9g">