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

    <tr>
        <th>Summary</th>
        <td>
            IR Outliner crashes when external phi node is shared by multiple outlined regions.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:crash,
            llvm:optimizations
      </td>
    </tr>

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

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

<pre>
    Reproduced: https://godbolt.org/z/j9sK47KM7

The IR Outliner is supposed to extract the outputs contained in an external phi node and place them into a phi node contained within the outlined function.  However, when the output values of two outlined functions with two different output sets are contained within the same phi node, they are counted as the same exit path when first analyzed.  In reality, these create two different phi nodes, creating an inconsistency, resulting in a mismatch in the expected number of output paths and a crash.

Patch developed for this, and incoming soon.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U9tu2zAM_Rr7RZjh2LnUD37IVhQrumFDsR-QLTpWJ0uGSCVNv36U5i5piwG-iZfDw0O6c-rcPsLsnQo9qKzei5FoRv7Iqju-Dk51zlDh_IFPL3w_Nfiw3j1832XlbVbu_z5_jSDuH8WPQEZb8EKjwDDPDkEJcgKeycueBHGYCzQHQtE7S5KDldBWSBtjwFtpxDxqYZ0CNioxG9lDzJs4jJHkxX0BOGkaGWRBN8k2BNuTdrYQ4qs7wRF8Vn0RpxHsFQtxlCYACjcIOrmPyZigk0_pYQAPll5TEbgJ6f_DA-UE_6jGymw8L-HBEgdLvATCsyYxSy6VCA7aI3H70pxfQHEH91Z4kEbTeYFCxmELwTturxUxxqUIbQ9RXW2ZJmoksH0C8YDBJG-UX0waJ0n9KBb-8DxDH2naMHU8UFZo6TvSxDQbyRUkjsX1IvxMIIr1Nm6OSjrPeDrxiTmRxxSrouPZXGfmqq1VUzcyJ00G2ut1SnV4Tkmdj4sSt21kbZXozmKKbc3mahU8HOIsizx4075bb55Y6ArmxAdjjq-vT_xHPLEAfNSIIep5t1lXZZOPbbnpV03fr-qbchhq2NaraiW3zdApqKqhr3MjOzDYZpvPWVUl0HqfOuBj1OFidTPpSb_ItGvRu7nNdVuVVVXW5Xq1W2_qddGUG6mg3jbbZre9KVfZuoRJalNEkPhj5r5NnLtwQHYanjJenBJRHyzAwmdvlYfTN00Ev8EuNWWg0fn2rS9Pnbep7T8XeG7y">