Skip to content

Commit

Permalink
Optimize away the redundant vector loads in the Wipeout games.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jun 8, 2024
1 parent 2ff91fa commit 5bfc025
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Core/MIPS/IR/IRPassSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5bfc025

Please sign in to comment.