Optimize away the redundant vector loads in the Wipeout games.

This commit is contained in:
Henrik Rydgård 2024-06-08 23:19:01 +02:00
parent 2ff91fab2b
commit 5bfc0259be

View File

@ -2200,13 +2200,23 @@ bool OptimizeLoadsAfterStores(const IRWriter &in, IRWriter &out, const IROptions
case IROp::Store32:
if (next.op == IROp::Load32 &&
next.constant == inst.constant &&
next.dest == inst.src3 &&
next.dest == inst.dest &&
next.src1 == inst.src1) {
// The upcoming load is completely redundant.
// Skip it.
i++;
}
break;
case IROp::StoreVec4:
if (next.op == IROp::LoadVec4 &&
next.constant == inst.constant &&
next.dest == inst.dest &&
next.src1 == inst.src1) {
// The upcoming load is completely redundant. These are common in Wipeout.
// Skip it. NOTE: It looks like vector load/stores uses different register assignments, but there's a union between dest and src3.
i++;
}
break;
default:
break;
}