MCPcopy Create free account
hub / github.com/beefytech/Beef / InitializedPassHelper

Method InitializedPassHelper

IDEHelper/Backend/BeMCContext.cpp:6664–6922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6662}
6663
6664void BeMCContext::InitializedPassHelper(BeMCBlock* mcBlock, BeVTrackingGenContext* genCtx, bool& modifiedBlockBefore, bool& modifiedBlockAfter)
6665{
6666 modifiedBlockBefore = false;
6667 modifiedBlockAfter = false;
6668
6669 genCtx->mBlocks[mcBlock->mBlockIdx].mGenerateCount++;
6670 genCtx->mCalls++;
6671
6672 genCtx->mHandledCalls++;
6673
6674 BeMDNode* curDbgScope = NULL;
6675
6676 BeVTrackingList* vregsInitialized = mcBlock->mPredVRegsInitialized;
6677
6678 //OutputDebugStrF("InitializedPassHelper %@\n", vregsInitialized.mList);
6679
6680 mActiveBlock = mcBlock;
6681 for (int instIdx = 0; instIdx < (int)mcBlock->mInstructions.size(); instIdx++)
6682 {
6683 genCtx->mInstructions++;
6684
6685 mInsertInstIdxRef = &instIdx;
6686 auto inst = mcBlock->mInstructions[instIdx];
6687
6688 inst->mVRegsInitialized = vregsInitialized;
6689
6690 bool deepSet = false;
6691
6692 if (inst->mKind == BeMCInstKind_LifetimeStart)
6693 continue;
6694
6695 SizedArray<int, 16> removeVec;
6696 SizedArray<int, 16> addVec;
6697 SizedArray<int, 16> filteredRemoveVec;
6698 SizedArray<int, 16> filteredAddVec;
6699
6700 //
6701 {
6702 auto checkLastUseRecord = inst->mVRegLastUseRecord;
6703 while (checkLastUseRecord != NULL)
6704 {
6705 removeVec.Add(checkLastUseRecord->mVRegIdx);
6706 checkLastUseRecord = checkLastUseRecord->mNext;
6707 }
6708 }
6709
6710 if ((inst->mKind == BeMCInstKind_ValueScopeSoftEnd) || (inst->mKind == BeMCInstKind_ValueScopeHardEnd))
6711 {
6712 bool isSoft = inst->mKind == BeMCInstKind_ValueScopeSoftEnd;
6713
6714 int startVRegIdx = (int)inst->mArg0.mImmediate;
6715 int endVRegIdx = (int)inst->mArg1.mImmediate;
6716
6717 int listIdx = mVRegInitializedContext.FindIndex(vregsInitialized, startVRegIdx);
6718 if (listIdx < 0)
6719 listIdx = ~listIdx;
6720 for (; listIdx < vregsInitialized->mSize; listIdx++)
6721 {

Callers

nothing calls this directly

Calls 13

BeMCOperandClass · 0.85
DedupPushBackFunction · 0.85
FindIndexMethod · 0.80
GetIdxMethod · 0.80
ModifyMethod · 0.80
IsVRegAnyMethod · 0.80
IsMovMethod · 0.80
GetDestMethod · 0.80
MergeMethod · 0.80
sizeMethod · 0.45
AddMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected