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

    <tr>
        <th>Summary</th>
        <td>
            [MachineSink] Sunk instructions violates live-in phys reg use.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:codegen
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            momchil-velikov
      </td>
    </tr>

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

<pre>
    ```
b.4.land.end570.thread:
; predecessors: %bb.2
  successors: %bb.2(0x80000000); %bb.2(100.00%)
 liveins: $cc
  %5:gr64bit = LOCGHI %4:gr64bit(tied-def 0), 1, 14, 12, implicit $cc
```
=>
 IR Dump After Machine code sinking (machine-sink) :
 Machine code for function func_21: IsSSA, TracksLiveness

```
bb.4.land.end570.thread:
; predecessors: %bb.2
  successors: %bb.2(0x80000000); %bb.2(100.00%)
  liveins: $cc
  %7:gr64bit = OILF64 %6:gr64bit(tied-def 0), 1732125427, implicit-def dead $cc
  %5:gr64bit = LOCGHI %4:gr64bit(tied-def 0), 1, 14, 12, implicit $cc
```
llc -mtriple=s390x-linux-gnu -verify-machineinstrs -sink-insts-to-avoid-spills [bugpoint-reduced-simplified.tar.gz](https://github.com/llvm/llvm-project/files/13923612/bugpoint-reduced-simplified.tar.gz)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVF1vrDYQ_TXmxQKZMebjgYfN3W6bKtWtmr5XYA-sG6-NbLNK-usrs6TbXkX9eOpFaAAfMzNnzoyHEPRsEXsiHgjAxV3kWZv8ika_uCsBIOKYDWs8O99_7-yPIThbZqNTbz2p2X6zI2GHsagKM1hVoFWiYUU8exwU4YcbTPgDXTwqlBiC84HwAyUgxrGA2wZKwyo_AKFlry27XQS65OcOlYwVaVkk5ObG6Ctqu7uopHz3TkAIwg-zr6tRR0r4kT59_vTtd48Jqe4IgTZqVLnCiW4B4RMtN1NtFpLVl8VomdzcQ3xRD8KPhH-zR3_8iR7Xy0IPU0RPfxjkWVuk0imkQdsXbWdKoL3c1vO0RKCjfxTvr39MztNptTJqZ7eXX6BMdB_D8_MhZfezH-RLeNJXtBjCns5HOY5fi2h_p1rzhWqfH59OdZWQ-h9UaziUICpo_izZtkXhoP7f9jBG0vwSvV4MEn4MvGOvudF2fc1nu9L8il5Pb_neEtqG6APdOiNPHyGPLh-uTqs8LNqYQIl4GNd5cdrG3KNaJao8bIlMGlURB1_MvxFxJNCeY1xSqQmcCJxmHc_rWEh3IXAy5vr-yBfvfkUZCZwmbTAQOJW8A14njqd_Eetd3ZvNVM9Vx7shw75smGBtJwTPzn01NiMDBSixrctqFFDJBqtp6hrF21ZlugcGFStLKDvRlbyoS2R1WyLUreATtKRieBm0KVLahfNzpkNYsW-arikzM4xown7Abfz4Ic3RjHY_33y_8R3XOZCKGR1iuLuKOprteNxn8DkNpzjS59W-0E2XdZvEQK_amSFi2Jo515Yu57dAPc50DVhkqzf9f678RiSVfuPyewAAAP__FOypBg">