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

    <tr>
        <th>Summary</th>
        <td>
            Compilation hangs in `TargetLowering::SimplifySetCC`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:RISC-V,
            llvm:hang
      </td>
    </tr>

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

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

<pre>
    ```llvm
target triple = "riscv32"

define i1 @f() {
  %B25 = shl i64 4294967296, -9223372036854775808
  %B13 = sub i64 -1, -9223372036854775808
  %C8 = icmp ugt i64 %B13, %B25
  %B5 = sub i64 0, 4294967296
  ret i1 %C8
}
```
https://godbolt.org/z/1n9PKa1ov

When compiling for riscv32 with llc the SDAG hits an infinite loop in `TargetLowering::SimplifySetCC` at [`llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:5098`](https://github.com/llvm/llvm-project/blob/71a7192d6927b422c224f5d231300774cb02348a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L5098).



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02PpDYQ_TXFxeqWKX-ADxwYEKMoc4jSUXI2YMCJGyPs7tHk16-AXm3PnnakltVAvVfvvSrrEOw4G1OAeAFRJ_oWJ78W3TToEJPW9x8FSHr8nLtfgdZAy6jX0UQSV7s4Q4DVBBBXG7o7Q0A8io6zN4OdDbEpAU4HwBxQEchejq-EAIoXFDtHmByxkhOOiiuZoZKAFTkpRMYypEzmgmeZyGn-DE7ZAb61O_iU_gKoyneM7a4LuY1xBx5cG_iQ9NxDfGpBt6InkY_C1cTd5kb_SCCrH3--R3g8TjEuAVgJ2AA2o-9b7-LZryNg8z9gk87qj9916u_PQf4zmZl0_rpYZ-eRDH4lj8TJu40Tca4jcTLkUpevZLIxED0TOw92ttEQ5_1C7ExA0r_24b35d7PaedxksPJir4uzw8fFxKoCSYmOZNuIx9CxcbYFbCrfm1czAzYX40wXrZ_r8hWw-cx57pYFWCmoyjfPogbMf_Js43Rrz53fuR8t3P16Wlb_r-kiYNM6v7XMUp2lCnupMGs5YofIB9EjSxmlWca7liLjuX7i-bJUZG-7VlTn58SPM-kL1iumdGKKVCrMKUchk6nQqZQiRyVzTilnnOU5MtUblfJeK00TWyBFRnNkqUCeyrPAXiPVg1FDy3nLgFNz1dadN-Xb_BMbws0UkismEqdb48J-MRFb3f1n5h5Y-edvl-r093bLsALE3TQrJz2P2ztRJ2uxJ9nexgCcOhti-NEg2uhMUe1rpLdQyIYMX1iN5La64svT3I0FwGb39i0AAP__VpFG8w">