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

    <tr>
        <th>Summary</th>
        <td>
            cttz.i32 fails to lower on mips16
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:MIPS
      </td>
    </tr>

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

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

<pre>
    ```ll
target triple = "mipsel-unknown-none"

define i32 @test(i32 %a) #0 {
 %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
  ret i32 %cttz
}

declare i32 @llvm.cttz.i32(i32, i1)

attributes #0 = { "target-features"="+mips16" }
```
Results in:
```
LLVM ERROR: Cannot select: t24: i32 = MipsISD::Lo TargetConstantPool:i32<[32 x i8] c"\00\01\1C\02\1D\0E\18\03\1E\16\14\0F\19\11\04\08\1F\1B\0D\17\15\13\10\07\1A\0C\12\06\0B\05\0A\09"> 0 [TF=5]
  t23: i32 = TargetConstantPool<[32 x i8] c"\00\01\1C\02\1D\0E\18\03\1E\16\14\0F\19\11\04\08\1F\1B\0D\17\15\13\10\07\1A\0C\12\06\0B\05\0A\09"> 0 [TF=5]
In function: test
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVN1u6ygQfhp8gxLhwfjnwhdJ3EiVWm2VVntP7HHClkBk8HZ3n341ODk9larzAEeKhmGY-fjmC2Mdgjk5xJapLVNdpud49lPrzLvps6Mf_m1ZKZaftUx0TGyink4YeZzM1SJnsuMM4GKuAe1qdu_Of7iV8w4ZwFKw2AFH45AbCZwVImKIDOq0A6UZNJyBFJxV2yWdwn2M_6ULem3tvdLavy9rOlkbCV8gdtzkfNQ2IIPmhsInjPyWQkU3RlX3lVpv9YS_uGEB_wG7WB3jZI5zxHDjTlJUW5Jj0Wg1oo7zhIGkkB1Z2JJSeckA-CeLu8TL9oBhtjFw45jcfJvx9PTnM384HP44MLnhO-2cjzygxT5SIEJBS2pHdvzZXMPja0dgcvPk-Vsit_MuRO3ii_eWyQ01KXdMbSXwf7ipmep4T4zVTggyOVO7fEcexfKOvAfyavIkeWlbkikotievIUO1IsUoOU8HW9oSSl6RUWQSSrotxTbk0ZV5okHIIpVRskinTZL2gQvO1PZtz2SnmOruf34E-bMQ3zX-e7X86Pg4uz4a79JDoCn7-oCyoZVDIxudYZuXVaUaCSCyc9sXOOCghrwcVVFirVWvZVNjXY59pbTMTAsCpACo80JUQqxhLGoFstdNMRzHEVgh8KKNXacB8tMpMyHM2Ja5UCqz-og2pO8MwFH37-gGJjfPjy-vSfMum1oqXB3nU6ApNCGGT6hoosX2PpV81MYGHj23_gMn7h1f5iqbJ9ueY7wGeu6wZ7A_mXiej-veXxjsCe-2rK6T_4smBvaJZ2CwT1T_DwAA__90zVbB">