IRJit: If we're in "JIT using IR" mode, don't accidentally optimize for the interpreter.

This commit is contained in:
Henrik Rydgård 2024-06-11 10:24:08 +02:00
parent 5dec3ca2db
commit 9ef5250387
4 changed files with 7 additions and 6 deletions

View File

@ -44,11 +44,12 @@
namespace MIPSComp {
IRJit::IRJit(MIPSState *mipsState) : frontend_(mipsState->HasDefaultPrefix()), mips_(mipsState) {
IRJit::IRJit(MIPSState *mipsState, bool actualJit) : frontend_(mipsState->HasDefaultPrefix()), mips_(mipsState) {
// u32 size = 128 * 1024;
InitIR();
jo.optimizeForInterpreter = true;
// If this IRJit instance will be used to drive a "JIT using IR", don't optimize for interpretation.
jo.optimizeForInterpreter = !actualJit;
IROptions opts{};
opts.disableFlags = g_Config.uJitDisableFlags;

View File

@ -195,7 +195,7 @@ private:
class IRJit : public JitInterface {
public:
IRJit(MIPSState *mipsState);
IRJit(MIPSState *mipsState, bool actualJit);
~IRJit();
void DoState(PointerWrap &p) override;

View File

@ -481,7 +481,7 @@ void IRNativeBackend::CompileIRInst(IRInst inst) {
}
IRNativeJit::IRNativeJit(MIPSState *mipsState)
: IRJit(mipsState), debugInterface_(blocks_) {}
: IRJit(mipsState, true), debugInterface_(blocks_) {}
void IRNativeJit::Init(IRNativeBackend &backend) {
backend_ = &backend;

View File

@ -214,7 +214,7 @@ void MIPSState::Init() {
if (PSP_CoreParameter().cpuCore == CPUCore::JIT || PSP_CoreParameter().cpuCore == CPUCore::JIT_IR) {
MIPSComp::jit = MIPSComp::CreateNativeJit(this, PSP_CoreParameter().cpuCore == CPUCore::JIT_IR);
} else if (PSP_CoreParameter().cpuCore == CPUCore::IR_INTERPRETER) {
MIPSComp::jit = new MIPSComp::IRJit(this);
MIPSComp::jit = new MIPSComp::IRJit(this, false);
} else {
MIPSComp::jit = nullptr;
}
@ -252,7 +252,7 @@ void MIPSState::UpdateCore(CPUCore desired) {
MIPSComp::jit = nullptr;
delete oldjit;
}
newjit = new MIPSComp::IRJit(this);
newjit = new MIPSComp::IRJit(this, false);
break;
case CPUCore::INTERPRETER: