From 535445947623a5866d9b1f6f3e33e38bb0367972 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 10 Jan 2021 16:41:45 -0800 Subject: [PATCH] irjit: Update clobber flag on inst swap. Fixes IR in Persona 3. --- Core/MIPS/IR/IRPassSimplify.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/MIPS/IR/IRPassSimplify.cpp b/Core/MIPS/IR/IRPassSimplify.cpp index d34cb06ed0..ee65084a60 100644 --- a/Core/MIPS/IR/IRPassSimplify.cpp +++ b/Core/MIPS/IR/IRPassSimplify.cpp @@ -835,6 +835,8 @@ bool PurgeTemps(const IRWriter &in, IRWriter &out, const IROptions &opts) { insts[check.index] = IRReplaceDestGPR(insts[check.index], check.reg, inst.dest); lastWrittenTo[inst.dest] = check.index; check.reg = inst.dest; + // Update the read by exit flag to match the new reg. + check.readByExit = inst.dest < IRTEMP_0 || inst.dest > IRTEMP_LR_SHIFT; // And swap the args for this mov, since we changed the other dest. We'll optimize this out later. std::swap(inst.dest, inst.src1); } else {