mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nv50/peephole: merge/split can swap word order
and we would prevoisly incorrectly apply MergeSplits in this case
That is,
a, b = split(x)
y = merge(b, a)
could be incorrectly optimized to
y = x
before this commit
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24984>
This commit is contained in:
parent
71ca8529c5
commit
879343839b
1 changed files with 2 additions and 0 deletions
|
|
@ -137,6 +137,8 @@ MergeSplits::visit(BasicBlock *bb)
|
|||
si = i->getSrc(0)->getInsn();
|
||||
if (si->op != OP_SPLIT || si != i->getSrc(1)->getInsn())
|
||||
continue;
|
||||
if (i->getSrc(0) != si->getDef(0) || i->getSrc(1) != si->getDef(1))
|
||||
continue;
|
||||
i->def(0).replace(si->getSrc(0), false);
|
||||
delete_Instruction(prog, i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue