Skip to content

Commit 5bfc025

Browse files
committed
Optimize away the redundant vector loads in the Wipeout games.
1 parent 2ff91fa commit 5bfc025

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Core/MIPS/IR/IRPassSimplify.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -2200,13 +2200,23 @@ bool OptimizeLoadsAfterStores(const IRWriter &in, IRWriter &out, const IROptions
22002200
case IROp::Store32:
22012201
if (next.op == IROp::Load32 &&
22022202
next.constant == inst.constant &&
2203-
next.dest == inst.src3 &&
2203+
next.dest == inst.dest &&
22042204
next.src1 == inst.src1) {
22052205
// The upcoming load is completely redundant.
22062206
// Skip it.
22072207
i++;
22082208
}
22092209
break;
2210+
case IROp::StoreVec4:
2211+
if (next.op == IROp::LoadVec4 &&
2212+
next.constant == inst.constant &&
2213+
next.dest == inst.dest &&
2214+
next.src1 == inst.src1) {
2215+
// The upcoming load is completely redundant. These are common in Wipeout.
2216+
// Skip it. NOTE: It looks like vector load/stores uses different register assignments, but there's a union between dest and src3.
2217+
i++;
2218+
}
2219+
break;
22102220
default:
22112221
break;
22122222
}

0 commit comments

Comments
 (0)