<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54210>54210</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
IR Outliner hits assertion with two identical external phi nodes
</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>
https://godbolt.org/z/63r5hzKsT
When there are two external phi nodes for two different outlined regions, when compressing the created phi nodes between the two regions, the matching for the second phi node in the second region matches the first phi node created for the first region rather than the second phi node created for the first region. This adds an extra output path where there should not be one.
The fix is the ignore phi nodes that have already been matched for each region. Patch incoming soon.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U02PnDAM_TVwiYqYAEPnwGG6q5WqVmpVjdRzIIZkm0lQYpbd-fV1YKZMP1QJgmzHz_Z7pnXyrVGIY0iKY8Kf6BmcbJ3BzPmBrAu9-8JX6vIpnJL8McmP6_ldgWWowAMT9OLsGLwieCsMG5Vm1kkIrHd-CUnd93TVInMTGm1BMg-DdjYk_IHNEatz59FDCNoOEZd1HgTSvQ2sBZxhrbqA3iFE11lgp2L2UpQcATpnNwCm7b17zV6zCDxGeu0DbvdvHdzw1vA1z4s4PPmF_Wex_yVnjJ2UDkxISYeNxHkRmRknKk_AkZFI6nIG5SYjCRWJAeYsZPc6nBbsV6bXEfRgHeVspFGDyJR4IZkMtSTfCARuY6_tgejUr86-xgBRRXJELoMjZyqbQh6Kg0hRo4Hm4zf2ZZXRM6WRZggBPEZaZk3dR3G0JLV1R9vw91qkkzd_bh3lTW1GVckw5uX2eTd69wwdkqlDmIDUfqpKvstT1ezr9iDqMm95BSLnYrfroav7nZR5W8pSpka0YEKTVB8SzhfQ4th5ERSZcWs2rxtRn_VF4LpQPKkeU93wnPO8yMtdXR54kVVlva_L-iAKIXhdv0_KHM5CmyyCxP8l9c3SczsNgYJGBwxbkEgidQCu_Ryt9DB_1ojwA-y1pphQOd_8HkuXyZtl7J97lkZI">