<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72508>72508</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MachinePipeliner] Store-After-Store order dependency is not considered
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
komalon1
</td>
</tr>
</table>
<pre>
See reproducer in: https://godbolt.org/z/vEv5r6Md7
We have 2 aliased stores in the loop that have order dependency:
`SU(5): STBX8 %19:g8rc, %7:g8rc_and_g8rc_nox0, %18:g8rc :: (store (s8) into %ir.17)
# preds left : 1
# succs left : 1
# rdefs left : 0
Latency : 1
Depth : 6
Height : 0
Predecessors:
SU(4): Data Latency=2 Reg=%18
Successors:
SU(11): Ord Latency=0 Memory`
and
`SU(11): STBX8 %25:g8rc, %8:g8rc_and_g8rc_nox0, %24:g8rc :: (store (s8) into %ir.18)
# preds left : 2
# succs left : 0
# rdefs left : 0
Latency : 1
Depth : 12
Height : 0
Predecessors:
SU(10): Data Latency=2 Reg=%24
SU(5): Ord Latency=0 Memory`
But the pipeliner schedules the two stores at different stages which is illegal:
`
Inst (5) STBX8 %19:g8rc, %7:g8rc_and_g8rc_nox0, %18:g8rc :: (store (s8) into %ir.17)
es: 6 ls: 7fffffff me: 7fffffff ms: 80000000
Trying to insert node between 6 and 9 II: 4
insert at cycle 6 STBX8 %19:g8rc, %7:g8rc_and_g8rc_nox0, %18:g8rc :: (store (s8) into %ir.17)
Inst (11) STBX8 %25:g8rc, %8:g8rc_and_g8rc_nox0, %24:g8rc :: (store (s8) into %ir.18)
es: d ls: 7fffffff me: 7fffffff ms: 80000000
Trying to insert node between 13 and 16 II: 4
insert at cycle 13 STBX8 %25:g8rc, %8:g8rc_and_g8rc_nox0, %24:g8rc :: (store (s8) into %ir.18)
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElk1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