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

    <tr>
        <th>Summary</th>
        <td>
            Crash when looking up zero-width APInt in DenseMap
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            llvm:core
      </td>
    </tr>

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

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

<pre>
    To reproduce: performing a lookup of a non-empty DenseMap with a zero-width APInt causes a crash. I expect this to be due to some issues with hashing of the zero-width APInt.

```C++
    DenseMap<APInt, mlir::Value> m;
    m.insert({APInt(1, 1, false), nullptr});
    m.find(APInt(0, 0, false)); // <--- crashes
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxlUk2PnDAM_TXhEoFCMsBwyGF2ppX2UKmHqvcAZkgbCMpHp9tfXyez03a7yHIc2-85thns9CK_WOpgd3aKIxBxoju42bpVb1eqqLH2e9ypndHe7FbCuocXeoHNwye105sOC0Z-gbPlTU94OX1-3gIdVfTgMTI65ZeKPlP4ucMYaFi0p8HSAegUIVnerkC19xHzM92CiFQca4YF3nFXhF0IO73qlt3lTPhTkuyl-D2eSMQ5wwg_09Vohx2ifFUmYrMf6ErEP6C10ohymHwk3dMr7lgnbFazMh4I75O9RWP24Eh3SY63LLPeJgQ-CFjKZ28JEoQS_hGF4hvLsrzPCvx_nRUg67Y98LbtGlFMUky96FURdDAgzwlCbwtseVNpbLitd-vQ2595FNEZuYSw-zSJXP-KU49DNdoVL8b8eBwl_hTfcGl4ve8HjebIalEskoOagTccuFD13I0wtf0wN6JlBz4MShRGDWC8JA2uhQ_xijoNAI9cQZxG6yA5m0uhJWecs5537Fj3taj6Hg5D10HD1XwEaMmBwaq0qRK2su5aOJlfiMQeg0b74P8Glff6ugHk6sivYlisk6t1YbA7hCK3I3MvvwEExux5">