SPU LLVM: Remove dead interpreter ret fallback

This commit is contained in:
Malcolm
2026-05-19 22:18:53 -04:00
committed by kd-11
parent b41b10a031
commit 3058a71d72
+10 -7
View File
@@ -3912,20 +3912,23 @@ public:
} }
else if (!(itype & spu_itype::branch)) else if (!(itype & spu_itype::branch))
{ {
// Hack: inline ret instruction before final jmp; this is not reliable. // Inline ret exits the instruction helper directly.
#ifdef ARCH_X64 #ifdef ARCH_X64
m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false, InlineAsm::AD_Intel)); m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false, InlineAsm::AD_Intel));
#else #else
m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false)); m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false));
#endif #endif
fret = ret_func; m_ir->CreateUnreachable();
} }
const auto arg3 = UndefValue::get(get_type<u32>()); if (!m_ir->GetInsertBlock()->getTerminator())
const auto _ret = m_ir->CreateCall(if_type, fret, {m_lsptr, m_thread, m_interp_pc, arg3, m_interp_table, m_interp_7f0, m_interp_regs}); {
_ret->setCallingConv(CallingConv::GHC); const auto arg3 = UndefValue::get(get_type<u32>());
_ret->setTailCall(); const auto _ret = m_ir->CreateCall(if_type, fret, {m_lsptr, m_thread, m_interp_pc, arg3, m_interp_table, m_interp_7f0, m_interp_regs});
m_ir->CreateRetVoid(); _ret->setCallingConv(CallingConv::GHC);
_ret->setTailCall();
m_ir->CreateRetVoid();
}
} }
if (!m_ir->GetInsertBlock()->getTerminator()) if (!m_ir->GetInsertBlock()->getTerminator())