Browse Source

Disable block merge with 'fake br'

Brian Fiete 3 years ago
parent
commit
720a3ad14f
2 changed files with 7 additions and 1 deletions
  1. 5 1
      IDEHelper/Backend/BeMCContext.cpp
  2. 2 0
      IDEHelper/Backend/BeMCContext.h

+ 5 - 1
IDEHelper/Backend/BeMCContext.cpp

@@ -7224,6 +7224,9 @@ void BeMCContext::DoChainedBlockMerge()
 	for (int blockIdx = 0; blockIdx < mBlocks.size() - 1; blockIdx++)
 	{
 		auto mcBlock = mBlocks[blockIdx];
+		if (mcBlock->mHasFakeBr)
+			continue;
+
 		auto nextMcBlock = mBlocks[blockIdx + 1];
 
 		// We only branch into one block, and the the next block only has current block as a predecessor?
@@ -16141,7 +16144,7 @@ void BeMCContext::Generate(BeFunction* function)
 	mDbgPreferredRegs[32] = X64Reg_R8;*/
 
 	//mDbgPreferredRegs[8] = X64Reg_RAX;
-	//mDebugging = (function->mName == "?NumberToString@NumberFormatter@System@bf@@SAXUStringView@23@HPEAVIFormatProvider@23@PEAVString@23@@Z");
+	mDebugging = (function->mName == "?CheckMatch@?$StringSplitEnumeratorBase@D@System@bf@@IEAA_NXZ");
 	//		|| (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
 	// 		|| (function->mName == "?Hey@Blurg@bf@@SAXXZ")
 	// 		;
@@ -17247,6 +17250,7 @@ void BeMCContext::Generate(BeFunction* function)
 					{
 						mcInst->mArg1.mKind = BeMCOperandKind_Immediate_i8;
 						mcInst->mArg1.mImmediate = 2;
+						mcBlock->mHasFakeBr = true;
 					}
 				}
 				break;

+ 2 - 0
IDEHelper/Backend/BeMCContext.h

@@ -660,6 +660,7 @@ public:
 	int mBlockIdx;
 	int mMaxDeclBlockId; // If blocks merge, this is the highest index
 	bool mIsLooped;
+	bool mHasFakeBr;
 	BeVTrackingList* mSuccLiveness;
 	BeVTrackingList* mSuccVRegsInitialized;
 	BeVTrackingList* mPredVRegsInitialized;
@@ -672,6 +673,7 @@ public:
 	{
 		mLabelIdx = -1;
 		mIsLooped = false;
+		mHasFakeBr = false;
 		mBlockIdx = -1;
 		mMaxDeclBlockId = -1;
 		mSuccLiveness = NULL;