From d046cb10a48d652a7a3c744ef2d46cb90efc709b Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 21 Jul 2021 07:42:46 -0700 Subject: [PATCH] Fixed mem vreg merge issue --- IDEHelper/Backend/BeMCContext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Backend/BeMCContext.cpp b/IDEHelper/Backend/BeMCContext.cpp index 0e9c82ed..27f699c8 100644 --- a/IDEHelper/Backend/BeMCContext.cpp +++ b/IDEHelper/Backend/BeMCContext.cpp @@ -3785,7 +3785,7 @@ BeMCOperand BeMCContext::AllocVirtualReg(BeType* type, int refCount, bool mustBe if (mDebugging) { - if (mcOperand.mVRegIdx == 227) + if (mcOperand.mVRegIdx == 7) { NOP; } @@ -7817,6 +7817,8 @@ void BeMCContext::DoInstCombinePass() if ((vregInfoDest->mIsExpr) || (vregInfoCheck->mIsExpr)) continue; + if ((vregInfoCheck->mForceMem) && (!vregInfoDest->mForceMem)) + continue; if ((!vregInfoDest->mForceMerge) && (!vregInfoDest->mIsRetVal)) { @@ -15853,7 +15855,7 @@ void BeMCContext::Generate(BeFunction* function) mDbgPreferredRegs[32] = X64Reg_R8;*/ //mDbgPreferredRegs[8] = X64Reg_RAX; - //mDebugging = (function->mName == "?GetVal@TestProgram@BeefTest@bf@@CATint@@XZ"); + //mDebugging = (function->mName == "?Negate__im@TimeSpan@System@bf@@SA?AU?$Result@VTimeSpan@System@bf@@@23@_J@Z"); // || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ"); // || (function->mName == "?Hey@Blurg@bf@@SAXXZ") // ;