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

    <tr>
        <th>Summary</th>
        <td>
            MachineVerification fails after @llvm.amdgcn.set.inactive.i32(i32 0, i32 poison)
        </td>
    </tr>

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

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

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

<pre>
    Test case:
```
; RUN: llc -march=amdgcn -mcpu=gfx1030 < %s

define i32 @f() {
bb:
  %i = call i32 @llvm.amdgcn.set.inactive.i32(i32 0, i32 poison)
  ret i32 %i
}

declare i32 @llvm.amdgcn.set.inactive.i32(i32, i32)
```
I get:
```
llc: /home/jayfoad2/git/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:370: llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() && "This is not a register operand!"' failed.
```
isel generates:
```
  %1:vgpr_32 = V_SET_INACTIVE_B32 killed %0:sreg_32, killed %2:sreg_32, implicit-def dead $scc, implicit $exec
```
SIFoldOperands folds it into:
```
  %1:vgpr_32 = V_SET_INACTIVE_B32 0, killed %2:sreg_32, implicit-def dead $scc, implicit $exec
```
SIWholeQuadMode turns this into:
```
32B       $vgpr0 = COPY %1:vgpr_32
```
Then MachineVerifier complains about it.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VE1v2zgT_jWjyyCCPLTk-KCDP-oih7R9Uzcv9mRQ5EhiS4kGSQXtv19IVuomSBeLXaxhCCDn83mGz8gQTNMzl5BvId8ncoit8-VX-aN2UieV0z_KI4eISgYGsYFsD9kGimz-X45iiw9fPoDYoLUKbzrpVQtiLzvdqB5vOnUeQOyb-vsiExmC2CFQHubg6au5Nj2jEYSwzGqgW6A1wmp7MVfVz9o4xhoEsUclrX0OsfapSy8F08AxNb1U0TxxagQB3Y5eGdBucj87E1wPtH7O6Dle8lBu5q5W-5ftKSs9__1ic6mfNV4xdocNx9_Raa0aqQQ6tK5joMM8DQI6NCYCHcb6N2fvvrJ6PgIdTK_soPl6sXOa33MPdLiXqjU9fzyzl71OWxAbscouA3vqxkbE5oEbEyL7X65ehl3uGo4P3MwDUq4PIw7chMA-GtcjFJkJVw-gAqhAIDq2JqAJ2LuIEv1zNTcnpwUQAa2wlsayTt-kxgS22HDPXkYOvyNweiILEJun5uxP48jEHh9Pn98dT3cfNrvj3eO701YQfjPWsh6dRyqC5-Z0mdzVQC8Npjtbo0y80VyjZjn6LINSv9rGK_7O6s3WPt8dnNUzoQFrZ3VAE9H00f1bONl_3fr_W2f5f4PU904zxsH3AeM01b_oXtAWLz-g5Yggm_rfffz0xytcb4YfW-5xfoeP7E1t2KNy3dlK0weUlRsimpgmuhR6LdYy4XJR3C5XhRAFJW25WCquskKsSa7yhaqVXCyFqkkrXunlSiempIxElhMtxHJNlC5qndW6yoVQq5w4h2XGnTQ2nWTvfJOYEAYuC7otKLGyYhum_UlUSfWNJ6Vs7vfvP30Zn3S-T3w5KbYamjBuDxNiuCaLJlouX0BUcpLSqISAsh5l8k9XXDJ4W7Yxnie10OGyQ9qhSpXrrqvi1UaZAAagw4TxzwAAAP__ujLJbg">