<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54211>54211</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
IR Outliner can mix up order of incoming values when compressing phi nodes if contain the same values
</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/KrKPojnqE
When matching PHINodes when margining functions the IROutliner only checks that an incoming value exists in phi node in overall function. It doesn't check the length, the order, or that the incoming block also matches. In the given example, we see that both phi nodes have the same incoming values, but from different blocks.
The fix will be to enforce stricter a match of the incoming value, and the incoming block as well when matching the created phi nodes. Patch coming soon.
cc @ornata
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtU1FvmzAQ_jXwYi0iJjTJAw_ZumpRp62qJu35MAe4NTazjyTtr98ZuqSNJoXA3XHfd993pnL1S9kRDSHJd4m841_r6soZWjjfcvTK172_f3BP9s_XJLtNst38_7tDK3og1Wnbiodv-x-uxiCOc9q32sZ8M1pF2tkgqEOxf_w5ktEWvXDWvAjVoXqOJSABVmirXB-7DmBGFHjSgQJnxdBpYRk-PrsDejDmjLwQYk-idhhsItc0Y05sBm1LXSK_TJHzNfoYOD8TxuSZsTKOu8AEN2vCEHHt9FKrD6wJT9APBiPCEUVAnFEqR915viA6OODUFKDHK0Eh9lYjica7XtS6adCjpZmb-d67-4shGn0SR81SK4Z0Am3jvGJk8loRWwjzqMI1H7VMZJELbP1flbwlZNjjhw3GF5VHIKwvetiEh4njDSA4Nvz9nEqJZJU5b4FApHWZ19t8CylpMljuH8V534r327OgcZg3Eae-smceiFODxxBi_uKrbrhgCbS9uDt3paM31ydYUzdWC0biwJjDv9unwbsnVMShDmFayF2xkstl2pW4kQU0WOF6s8xlsV3jFlYyayq1XOH2ZpMaqNCEMik-J1JOoPlOeQh8wGQ0-5J1A-lev8J07mO1uE11KTMpszxbLddFkd0smgKbPJcbWC9VXoFiF7EHbRYRJH57qS-nmauxDVw08Vu4FIENai3i2zw7W3s8ftdE-Iz2jRNG6pwvP9bSSXk5yf4LBtxchQ">