#ifdef DEBUG
if (verbose)
{
- printf(" Referenced in BB%02u, bbWeight is %s", bbNum, refCntWtd2str(block->getBBWeight(this)));
+ printf(" Referenced in " FMT_BB ", bbWeight is %s", bbNum,
+ refCntWtd2str(block->getBBWeight(this)));
if (isDominatedByFirstBB)
{
#ifdef DEBUG
if (verbose)
{
- printf(" Starting at BB%02u, bbWeight is %s", block->bbNum,
+ printf(" Starting at " FMT_BB ", bbWeight is %s", block->bbNum,
refCntWtd2str(block->getBBWeight(this)));
printf(", bestWeight is %s\n", refCntWtd2str(bestWeight));
#ifdef DEBUG
if (verbose)
{
- printf(" Considering BB%02u, bbWeight is %s", block->bbNum,
+ printf(" Considering " FMT_BB ", bbWeight is %s", block->bbNum,
refCntWtd2str(block->getBBWeight(this)));
printf(", bestWeight is %s\n", refCntWtd2str(bestWeight));
#ifdef DEBUG
if (verbose)
{
- printf(" Insert copy at the %s of BB%02u\n",
+ printf(" Insert copy at the %s of " FMT_BB "\n",
(BlockSetOps::IsEmpty(this, paramImportantUseDom) ||
BlockSetOps::IsMember(this, varDsc->lvRefBlks, bestBlock->bbNum))
? "start"
{
printf("GenTreeNode creates assertion:\n");
gtDispTree(optAssertionPropCurrentTree, nullptr, nullptr, true);
- printf(optLocalAssertionProp ? "In BB%02u New Local " : "In BB%02u New Global ", compCurBB->bbNum);
+ printf(optLocalAssertionProp ? "In " FMT_BB " New Local " : "In " FMT_BB " New Global ", compCurBB->bbNum);
optPrintAssertion(newAssertion, optAssertionCount);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nAssertion prop in BB%02u:\n", compCurBB->bbNum);
+ printf("\nAssertion prop in " FMT_BB ":\n", compCurBB->bbNum);
optPrintAssertion(curAssertion, index);
gtDispTree(newTree, nullptr, nullptr, true);
}
#ifdef DEBUG
if (verbose)
{
- printf("\nAssertion prop in BB%02u:\n", compCurBB->bbNum);
+ printf("\nAssertion prop in " FMT_BB ":\n", compCurBB->bbNum);
optPrintAssertion(curAssertion, index);
gtDispTree(tree, nullptr, nullptr, true);
}
#ifdef DEBUG
if (verbose)
{
- printf("\nVN relop based constant assertion prop in BB%02u:\n", compCurBB->bbNum);
+ printf("\nVN relop based constant assertion prop in " FMT_BB ":\n", compCurBB->bbNum);
printf("Assertion index=#%02u: ", index);
printTreeID(op1);
printf(" %s ", (curAssertion->assertionKind == OAK_EQUAL) ? "==" : "!=");
#ifdef DEBUG
if (verbose)
{
- printf("\nVN relop based copy assertion prop in BB%02u:\n", compCurBB->bbNum);
+ printf("\nVN relop based copy assertion prop in " FMT_BB ":\n", compCurBB->bbNum);
printf("Assertion index=#%02u: V%02d.%02d %s V%02d.%02d\n", index, op1->gtLclVar.gtLclNum,
op1->gtLclVar.gtSsaNum, (curAssertion->assertionKind == OAK_EQUAL) ? "==" : "!=",
op2->gtLclVar.gtLclNum, op2->gtLclVar.gtSsaNum);
#ifdef DEBUG
if (verbose)
{
- printf("\nAssertion prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ printf("\nAssertion prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nSubrange prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ printf("\nSubrange prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nSubrange prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ printf("\nSubrange prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- (vnBased) ? printf("\nVN based non-null prop in BB%02u:\n", compCurBB->bbNum)
- : printf("\nNon-null prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ (vnBased) ? printf("\nVN based non-null prop in " FMT_BB ":\n", compCurBB->bbNum)
+ : printf("\nNon-null prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- (vnBased) ? printf("\nVN based non-null prop in BB%02u:\n", compCurBB->bbNum)
- : printf("\nNon-null prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ (vnBased) ? printf("\nVN based non-null prop in " FMT_BB ":\n", compCurBB->bbNum)
+ : printf("\nNon-null prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(call, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nDid VN based subtype prop for index #%02u in BB%02u:\n", index, compCurBB->bbNum);
+ printf("\nDid VN based subtype prop for index #%02u in " FMT_BB ":\n", index, compCurBB->bbNum);
gtDispTree(call, nullptr, nullptr, true);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nFlagging check redundant due to JitNoRangeChks in BB%02u:\n", compCurBB->bbNum);
+ printf("\nFlagging check redundant due to JitNoRangeChks in " FMT_BB ":\n", compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nVN based redundant (%s) bounds check assertion prop for index #%02u in BB%02u:\n", dbgMsg,
+ printf("\nVN based redundant (%s) bounds check assertion prop for index #%02u in " FMT_BB ":\n", dbgMsg,
assertionIndex, compCurBB->bbNum);
gtDispTree(tree, nullptr, nullptr, true);
}
// At the start of the merge function of the dataflow equations, initialize premerge state (to detect change.)
void StartMerge(BasicBlock* block)
{
- JITDUMP("AssertionPropCallback::StartMerge: BB%02d in -> %s\n", block->bbNum,
+ JITDUMP("AssertionPropCallback::StartMerge: " FMT_BB " in -> %s\n", block->bbNum,
BitVecOps::ToString(apTraits, block->bbAssertionIn));
BitVecOps::Assign(apTraits, preMergeOut, block->bbAssertionOut);
BitVecOps::Assign(apTraits, preMergeJumpDestOut, mJumpDestOut[block->bbNum]);
ASSERT_TP pAssertionOut = ((predBlock->bbJumpKind == BBJ_COND) && (predBlock->bbJumpDest == block))
? mJumpDestOut[predBlock->bbNum]
: predBlock->bbAssertionOut;
- JITDUMP("AssertionPropCallback::Merge : BB%02d in -> %s, predBlock BB%02d out -> %s\n", block->bbNum,
- BitVecOps::ToString(apTraits, block->bbAssertionIn), predBlock->bbNum,
+ JITDUMP("AssertionPropCallback::Merge : " FMT_BB " in -> %s, predBlock " FMT_BB " out -> %s\n",
+ block->bbNum, BitVecOps::ToString(apTraits, block->bbAssertionIn), predBlock->bbNum,
BitVecOps::ToString(apTraits, predBlock->bbAssertionOut));
BitVecOps::IntersectionD(apTraits, block->bbAssertionIn, pAssertionOut);
}
// At the end of the merge store results of the dataflow equations, in a postmerge state.
bool EndMerge(BasicBlock* block)
{
- JITDUMP("AssertionPropCallback::EndMerge : BB%02d in -> %s\n\n", block->bbNum,
+ JITDUMP("AssertionPropCallback::EndMerge : " FMT_BB " in -> %s\n\n", block->bbNum,
BitVecOps::ToString(apTraits, block->bbAssertionIn));
BitVecOps::DataFlowD(apTraits, block->bbAssertionOut, block->bbAssertionGen, block->bbAssertionIn);
if (changed)
{
- JITDUMP("AssertionPropCallback::Changed : BB%02d before out -> %s; after out -> %s;\n"
+ JITDUMP("AssertionPropCallback::Changed : " FMT_BB " before out -> %s; after out -> %s;\n"
"\t\tjumpDest before out -> %s; jumpDest after out -> %s;\n\n",
block->bbNum, BitVecOps::ToString(apTraits, preMergeOut),
BitVecOps::ToString(apTraits, block->bbAssertionOut),
}
else
{
- JITDUMP("AssertionPropCallback::Unchanged : BB%02d out -> %s; \t\tjumpDest out -> %s\n\n", block->bbNum,
- BitVecOps::ToString(apTraits, block->bbAssertionOut),
+ JITDUMP("AssertionPropCallback::Unchanged : " FMT_BB " out -> %s; \t\tjumpDest out -> %s\n\n",
+ block->bbNum, BitVecOps::ToString(apTraits, block->bbAssertionOut),
BitVecOps::ToString(apTraits, mJumpDestOut[block->bbNum]));
}
#ifdef DEBUG
if (verbose)
{
- printf("\nBB%02u valueGen = %s", block->bbNum, BitVecOps::ToString(apTraits, block->bbAssertionGen));
+ printf("\n" FMT_BB " valueGen = %s", block->bbNum, BitVecOps::ToString(apTraits, block->bbAssertionGen));
if (block->bbJumpKind == BBJ_COND)
{
- printf(" => BB%02u valueGen = %s,", block->bbJumpDest->bbNum,
+ printf(" => " FMT_BB " valueGen = %s,", block->bbJumpDest->bbNum,
BitVecOps::ToString(apTraits, jumpDestGen[block->bbNum]));
}
}
printf("\n");
for (BasicBlock* block = fgFirstBB; block; block = block->bbNext)
{
- printf("\nBB%02u", block->bbNum);
+ printf("\n" FMT_BB, block->bbNum);
printf(" valueIn = %s", BitVecOps::ToString(apTraits, block->bbAssertionIn));
printf(" valueOut = %s", BitVecOps::ToString(apTraits, block->bbAssertionOut));
if (block->bbJumpKind == BBJ_COND)
{
- printf(" => BB%02u", block->bbJumpDest->bbNum);
+ printf(" => " FMT_BB, block->bbJumpDest->bbNum);
printf(" valueOut= %s", BitVecOps::ToString(apTraits, bbJtrueAssertionOut[block->bbNum]));
}
}
break;
}
- JITDUMP("Propagating %s assertions for BB%02d, stmt [%06d], tree [%06d], tree -> %d\n",
+ JITDUMP("Propagating %s assertions for " FMT_BB ", stmt [%06d], tree [%06d], tree -> %d\n",
BitVecOps::ToString(apTraits, assertions), block->bbNum, dspTreeID(stmt), dspTreeID(tree),
tree->GetAssertionInfo().GetAssertionIndex());
printf(",");
count += 1;
}
- printf("BB%02u", pred->flBlock->bbNum);
+ printf(FMT_BB, pred->flBlock->bbNum);
count += 4;
// Account for %02u only handling 2 digits, but we can display more than that.
printf(",");
count += 1;
}
- printf("BB%02u", pred->block->bbNum);
+ printf(FMT_BB, pred->block->bbNum);
count += 4;
// Account for %02u only handling 2 digits, but we can display more than that.
for (unsigned i = 0; i < numSuccs; i++)
{
printf("%s", (count == 0) ? "" : ",");
- printf("BB%02u", GetSucc(i, compiler)->bbNum);
+ printf(FMT_BB, GetSucc(i, compiler)->bbNum);
count++;
}
return count;
break;
case BBJ_EHCATCHRET:
- printf(" -> BB%02u (cret)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (cret)", bbJumpDest->bbNum);
break;
case BBJ_THROW:
case BBJ_ALWAYS:
if (bbFlags & BBF_KEEP_BBJ_ALWAYS)
{
- printf(" -> BB%02u (ALWAYS)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (ALWAYS)", bbJumpDest->bbNum);
}
else
{
- printf(" -> BB%02u (always)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (always)", bbJumpDest->bbNum);
}
break;
case BBJ_LEAVE:
- printf(" -> BB%02u (leave)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (leave)", bbJumpDest->bbNum);
break;
case BBJ_CALLFINALLY:
- printf(" -> BB%02u (callf)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (callf)", bbJumpDest->bbNum);
break;
case BBJ_COND:
- printf(" -> BB%02u (cond)", bbJumpDest->bbNum);
+ printf(" -> " FMT_BB " (cond)", bbJumpDest->bbNum);
break;
case BBJ_SWITCH:
jumpTab = bbJumpSwt->bbsDstTab;
do
{
- printf("%cBB%02u", (jumpTab == bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
+ printf("%c" FMT_BB, (jumpTab == bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
} while (++jumpTab, --jumpCnt);
printf(" (switch)");
bool showFlags /*= false*/,
bool showPreds /*= true*/)
{
- printf("BB%02u ", bbNum);
+ printf(FMT_BB " ", bbNum);
dspBlockILRange();
if (showKind)
{
auto& buffer = buffers[nextBufferIndex];
nextBufferIndex = (nextBufferIndex + 1) % _countof(buffers);
- _snprintf_s(buffer, _countof(buffer), _countof(buffer), "BB%02u%*s [%04u]", bbNum, blockNumPadding, "", bbID);
+ _snprintf_s(buffer, _countof(buffer), _countof(buffer), FMT_BB "%*s [%04u]", bbNum, blockNumPadding, "", bbID);
return buffer;
}
typedef BitVec_ValArg_T ASSERT_VALARG_TP;
typedef BitVec_ValRet_T ASSERT_VALRET_TP;
+// We use the following format when print the BasicBlock number: bbNum
+// This define is used with string concatenation to put this in printf format strings (Note that %u means unsigned int)
+#define FMT_BB "BB%02u"
+
/*****************************************************************************
*
* Each basic block ends with a jump which is described as a value
BasicBlock* target = *jumpTable++;
noway_assert(target->bbFlags & BBF_JMP_TARGET);
- JITDUMP(" DD L_M%03u_BB%02u\n", Compiler::s_compMethodsCount, target->bbNum);
+ JITDUMP(" DD L_M%03u_" FMT_BB "\n", Compiler::s_compMethodsCount, target->bbNum);
getEmitter()->emitDataGenData(i, target);
}
BasicBlock* target = *jumpTable++;
noway_assert(target->bbFlags & BBF_JMP_TARGET);
- JITDUMP(" DD L_M%03u_BB%02u\n", Compiler::s_compMethodsCount, target->bbNum);
+ JITDUMP(" DD L_M%03u_" FMT_BB "\n", Compiler::s_compMethodsCount, target->bbNum);
getEmitter()->emitDataGenData(i, target);
};
#ifdef DEBUG
if (compiler->opts.dspCode)
{
- printf("\n L_M%03u_BB%02u:\n", Compiler::s_compMethodsCount, label->bbNum);
+ printf("\n L_M%03u_" FMT_BB ":\n", Compiler::s_compMethodsCount, label->bbNum);
}
#endif
#ifdef DEBUG
if (compiler->verbose)
{
- printf("\nEmitting finally target NOP predecessor for BB%02u\n", block->bbNum);
+ printf("\nEmitting finally target NOP predecessor for " FMT_BB "\n", block->bbNum);
}
#endif
// Create a label that we'll use for computing the start of an EH region, if this block is
{
assert(block != nullptr);
- JITDUMP("Reserving prolog IG for block BB%02u\n", block->bbNum);
+ JITDUMP("Reserving prolog IG for block " FMT_BB "\n", block->bbNum);
/* Nothing is live on entry to the prolog */
}
}
- JITDUMP("Reserving epilog IG for block BB%02u\n", block->bbNum);
+ JITDUMP("Reserving epilog IG for block " FMT_BB "\n", block->bbNum);
assert(block != nullptr);
const VARSET_TP& gcrefVarsArg(getEmitter()->emitThisGCrefVars);
noway_assert((gcInfo.gcRegGCrefSetCur & RBM_EXCEPTION_OBJECT) == gcInfo.gcRegGCrefSetCur);
noway_assert(gcInfo.gcRegByrefSetCur == 0);
- JITDUMP("Reserving funclet prolog IG for block BB%02u\n", block->bbNum);
+ JITDUMP("Reserving funclet prolog IG for block " FMT_BB "\n", block->bbNum);
getEmitter()->emitCreatePlaceholderIG(IGPT_FUNCLET_PROLOG, block, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur,
gcInfo.gcRegByrefSetCur, false);
{
assert(block != nullptr);
- JITDUMP("Reserving funclet epilog IG for block BB%02u\n", block->bbNum);
+ JITDUMP("Reserving funclet epilog IG for block " FMT_BB "\n", block->bbNum);
bool last = (block->bbNext == nullptr);
getEmitter()->emitCreatePlaceholderIG(IGPT_FUNCLET_EPILOG, block, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur,
#ifdef DEBUG
if (compiler->opts.dspCode)
{
- printf("\n L_M%03u_BB%02u:\n", Compiler::s_compMethodsCount, block->bbNum);
+ printf("\n L_M%03u_" FMT_BB ":\n", Compiler::s_compMethodsCount, block->bbNum);
}
#endif
if (nonVarPtrRegs)
{
- printf("Regset after BB%02u gcr=", block->bbNum);
+ printf("Regset after " FMT_BB " gcr=", block->bbNum);
printRegMaskInt(gcInfo.gcRegGCrefSetCur & ~regSet.rsMaskVars);
compiler->getEmitter()->emitDispRegSet(gcInfo.gcRegGCrefSetCur & ~regSet.rsMaskVars);
printf(", byr=");
BasicBlock* target = *jumpTable++;
noway_assert(target->bbFlags & BBF_JMP_TARGET);
- JITDUMP(" DD L_M%03u_BB%02u\n", Compiler::s_compMethodsCount, target->bbNum);
+ JITDUMP(" DD L_M%03u_" FMT_BB "\n", Compiler::s_compMethodsCount, target->bbNum);
getEmitter()->emitDataGenData(i, target);
};
printf("WorkList: ");
while (list != nullptr)
{
- printf("BB%02u ", list->block->bbNum);
+ printf(FMT_BB " ", list->block->bbNum);
list = list->next;
}
printf("\n");
printf("LOOP\n");
printf("\n");
- printf("HEAD BB%02u\n", blockHead->bbNum);
- printf("FIRST BB%02u\n", blockFirst->bbNum);
- printf("TOP BB%02u\n", blockTop->bbNum);
- printf("ENTRY BB%02u\n", blockEntry->bbNum);
+ printf("HEAD " FMT_BB "\n", blockHead->bbNum);
+ printf("FIRST " FMT_BB "\n", blockFirst->bbNum);
+ printf("TOP " FMT_BB "\n", blockTop->bbNum);
+ printf("ENTRY " FMT_BB "\n", blockEntry->bbNum);
if (loop->lpExitCnt == 1)
{
- printf("EXIT BB%02u\n", blockExit->bbNum);
+ printf("EXIT " FMT_BB "\n", blockExit->bbNum);
}
else
{
printf("EXITS %u", loop->lpExitCnt);
}
- printf("BOTTOM BB%02u\n", blockBottom->bbNum);
+ printf("BOTTOM " FMT_BB "\n", blockBottom->bbNum);
printf("\n");
cBlockIR(comp, blockHead);
}
else
{
- printf("BB%02u:\n", block->bbNum);
+ printf(FMT_BB ":\n", block->bbNum);
}
printf("\n");
case BBJ_EHCATCHRET:
chars += printf("BRANCH(EHCATCHRETURN)");
chars += dTabStopIR(chars, COLUMN_OPERANDS);
- chars += printf(" BB%02u", block->bbJumpDest->bbNum);
+ chars += printf(" " FMT_BB, block->bbJumpDest->bbNum);
break;
case BBJ_THROW:
case BBJ_ALWAYS:
chars += printf("BRANCH(ALWAYS)");
chars += dTabStopIR(chars, COLUMN_OPERANDS);
- chars += printf(" BB%02u", block->bbJumpDest->bbNum);
+ chars += printf(" " FMT_BB, block->bbJumpDest->bbNum);
if (block->bbFlags & BBF_KEEP_BBJ_ALWAYS)
{
chars += dTabStopIR(chars, COLUMN_KINDS);
case BBJ_LEAVE:
chars += printf("BRANCH(LEAVE)");
chars += dTabStopIR(chars, COLUMN_OPERANDS);
- chars += printf(" BB%02u", block->bbJumpDest->bbNum);
+ chars += printf(" " FMT_BB, block->bbJumpDest->bbNum);
break;
case BBJ_CALLFINALLY:
chars += printf("BRANCH(CALLFINALLY)");
chars += dTabStopIR(chars, COLUMN_OPERANDS);
- chars += printf(" BB%02u", block->bbJumpDest->bbNum);
+ chars += printf(" " FMT_BB, block->bbJumpDest->bbNum);
break;
case BBJ_COND:
chars += printf("BRANCH(COND)");
chars += dTabStopIR(chars, COLUMN_OPERANDS);
- chars += printf(" BB%02u", block->bbJumpDest->bbNum);
+ chars += printf(" " FMT_BB, block->bbJumpDest->bbNum);
break;
case BBJ_SWITCH:
jumpTab = block->bbJumpSwt->bbsDstTab;
do
{
- chars += printf("%c BB%02u", (jumpTab == block->bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
+ chars += printf("%c " FMT_BB, (jumpTab == block->bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
} while (++jumpTab, --jumpCnt);
break;
if (tree->gtLabel.gtLabBB)
{
- chars += printf("BB%02u", tree->gtLabel.gtLabBB->bbNum);
+ chars += printf(FMT_BB, tree->gtLabel.gtLabBB->bbNum);
}
else
{
void Compiler::optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curSsaName)
{
#ifdef DEBUG
- JITDUMP("Copy Assertion for BB%02u\n", block->bbNum);
+ JITDUMP("Copy Assertion for " FMT_BB "\n", block->bbNum);
if (verbose)
{
printf(" curSsaName stack: ");
#ifdef DEBUG
if (verbose)
{
- printf("optEarlyProp Rewriting BB%02u\n", compCurBB->bbNum);
+ printf("optEarlyProp Rewriting " FMT_BB "\n", compCurBB->bbNum);
gtDispTree(compCurStmt);
printf("\n");
}
#ifdef DEBUG
if (EMITVERBOSE)
{
- printf("Adjusted offset of block %02u from %04X to %04X\n", lstIG->igNum, lstIG->igOffs,
+ printf("Adjusted offset of " FMT_BB " from %04X to %04X\n", lstIG->igNum, lstIG->igOffs,
lstIG->igOffs - adjIG);
}
#endif // DEBUG
{
printf("Binding: ");
emitDispIns(jmp, false, false, false);
- printf("Binding L_M%03u_BB%02u ", Compiler::s_compMethodsCount, jmp->idAddr()->iiaBBlabel->bbNum);
+ printf("Binding L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, jmp->idAddr()->iiaBBlabel->bbNum);
}
#endif // DEBUG
}
else
{
- printf("-- ERROR, no emitter cookie for BB%02u; it is probably missing BBF_JMP_TARGET or "
+ printf("-- ERROR, no emitter cookie for " FMT_BB "; it is probably missing BBF_JMP_TARGET or "
"BBF_HAS_LABEL.\n",
jmp->idAddr()->iiaBBlabel->bbNum);
}
#ifdef DEBUG
if (EMITVERBOSE)
{
- printf("Adjusted offset of block %02u from %04X to %04X\n", lstIG->igNum, lstIG->igOffs,
+ printf("Adjusted offset of " FMT_BB " from %04X to %04X\n", lstIG->igNum, lstIG->igOffs,
lstIG->igOffs - adjIG);
}
#endif // DEBUG
emitRecordRelocation(&(bDst[i]), target, IMAGE_REL_BASED_HIGHLOW);
}
- JITDUMP(" BB%02u: 0x%p\n", block->bbNum, bDst[i]);
+ JITDUMP(" " FMT_BB ": 0x%p\n", block->bbNum, bDst[i]);
}
}
// relative label table
assert(FitsIn<uint32_t>(lab->igOffs - labFirst->igOffs));
uDst[i] = lab->igOffs - labFirst->igOffs;
- JITDUMP(" BB%02u: 0x%x\n", block->bbNum, uDst[i]);
+ JITDUMP(" " FMT_BB ": 0x%x\n", block->bbNum, uDst[i]);
}
}
else
if (id->idIsBound())
printf("G_M%03u_IG%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaIGlabel->igNum);
else
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
break;
case IF_T1_I: // Special Compare-and-branch
else if (id->idIsBound())
printf("G_M%03u_IG%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaIGlabel->igNum);
else
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
break;
}
else
{
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
}
break;
}
else
{
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
break;
}
else
{
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
break;
}
else
{
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
}
printf("]");
}
else
{
- printf("L_M%03u_BB%02u", Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
+ printf("L_M%03u_" FMT_BB, Compiler::s_compMethodsCount, id->idAddr()->iiaBBlabel->bbNum);
}
break;
#ifdef DEBUG
if (verbose)
{
- printf("New scratch BB%02u\n", block->bbNum);
+ printf("New scratch " FMT_BB "\n", block->bbNum);
}
#endif
}
unsigned bbNum = 0;
while (iter.NextElem(&bbNum))
{
- printf("BB%02u ", bbNum);
+ printf(FMT_BB " ", bbNum);
}
printf("\n");
}
printf("\nAfter doing a post order traversal of the BB graph, this is the ordering:\n");
for (unsigned i = 1; i <= fgBBNumMax; ++i)
{
- printf("%02u -> BB%02u\n", i, fgBBInvPostOrder[i]->bbNum);
+ printf("%02u -> " FMT_BB "\n", i, fgBBInvPostOrder[i]->bbNum);
}
printf("\n");
}
unsigned bbNum = 0;
while (iter.NextElem(&bbNum))
{
- printf("BB%02u ", bbNum);
+ printf(FMT_BB " ", bbNum);
}
printf("\n");
}
printf("PreOrder:\n");
for (i = 1; i <= fgBBNumMax; ++i)
{
- printf("BB%02u : %02u\n", i, fgDomTreePreOrder[i]);
+ printf(FMT_BB " : %02u\n", i, fgDomTreePreOrder[i]);
}
printf("PostOrder:\n");
for (i = 1; i <= fgBBNumMax; ++i)
{
- printf("BB%02u : %02u\n", i, fgDomTreePostOrder[i]);
+ printf(FMT_BB " : %02u\n", i, fgDomTreePostOrder[i]);
}
}
#endif // DEBUG
{
if (domTree[i] != nullptr)
{
- printf("BB%02u : ", i);
+ printf(FMT_BB " : ", i);
for (BasicBlockList* current = domTree[i]; current != nullptr; current = current->next)
{
assert(current->block);
- printf("BB%02u ", current->block->bbNum);
+ printf(FMT_BB " ", current->block->bbNum);
}
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("Could not compute loop iterations for loop from BB%02u to BB%02u", head->bbNum,
+ printf("Could not compute loop iterations for loop from " FMT_BB " to " FMT_BB, head->bbNum,
bottom->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Removing poll in block BB%02u because it forms a bounded counted loop\n", bottom->bbNum);
+ printf("Removing poll in block " FMT_BB " because it forms a bounded counted loop\n", bottom->bbNum);
}
#endif // DEBUG
}
#ifdef DEBUG
if (verbose)
{
- printf("Removing poll in block BB%02u because it is not loop\n", block->bbNum);
+ printf("Removing poll in block " FMT_BB " because it is not loop\n", block->bbNum);
}
#endif // DEBUG
continue;
#ifdef DEBUG
if (verbose)
{
- printf("Removing poll in block BB%02u because it is not a jump\n", block->bbNum);
+ printf("Removing poll in block " FMT_BB " because it is not a jump\n", block->bbNum);
}
#endif // DEBUG
block->bbFlags &= ~BBF_NEEDS_GCPOLL;
#ifdef DEBUG
if (verbose)
{
- printf("Removing poll in return block BB%02u because it is GC Safe\n", block->bbNum);
+ printf("Removing poll in return block " FMT_BB " because it is GC Safe\n", block->bbNum);
}
#endif // DEBUG
block->bbFlags &= ~BBF_NEEDS_GCPOLL;
#ifdef DEBUG
if (verbose)
{
- printf("Removing poll in return block BB%02u because it dominated by a call\n", block->bbNum);
+ printf("Removing poll in return block " FMT_BB " because it dominated by a call\n",
+ block->bbNum);
}
#endif // DEBUG
continue;
#ifdef DEBUG
if (verbose)
{
- printf("Selecting CALL poll in block BB%02u because of debug/minopts\n", block->bbNum);
+ printf("Selecting CALL poll in block " FMT_BB " because of debug/minopts\n", block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Selecting CALL poll in block BB%02u because it is the single return block\n", block->bbNum);
+ printf("Selecting CALL poll in block " FMT_BB " because it is the single return block\n", block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Selecting CALL poll in block BB%02u because it is a loop formed by a SWITCH\n", block->bbNum);
+ printf("Selecting CALL poll in block " FMT_BB " because it is a loop formed by a SWITCH\n",
+ block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("*** creating GC Poll in block BB%02u\n", block->bbNum);
+ printf("*** creating GC Poll in block " FMT_BB "\n", block->bbNum);
gtDispTreeList(block->bbTreeList);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("*** creating inlined GC Poll in top block BB%02u\n", top->bbNum);
+ printf("*** creating inlined GC Poll in top block " FMT_BB "\n", top->bbNum);
gtDispTreeList(top->bbTreeList);
- printf(" poll block is BB%02u\n", poll->bbNum);
+ printf(" poll block is " FMT_BB "\n", poll->bbNum);
gtDispTreeList(poll->bbTreeList);
- printf(" bottom block is BB%02u\n", bottom->bbNum);
+ printf(" bottom block is " FMT_BB "\n", bottom->bbNum);
gtDispTreeList(bottom->bbTreeList);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("fgMarkLoopHead: Checking loop head block BB%02u: ", block->bbNum);
+ printf("fgMarkLoopHead: Checking loop head block " FMT_BB ": ", block->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("Synchronized method - convert block BB%02u to BBJ_ALWAYS [targets BB%02u]\n", block->bbNum,
+ printf("Synchronized method - convert block " FMT_BB " to BBJ_ALWAYS [targets " FMT_BB "]\n", block->bbNum,
block->bbJumpDest->bbNum);
}
#endif
#ifdef DEBUG
if (comp->verbose)
{
- printf("\n newReturnBB [BB%02u] created\n", newReturnBB->bbNum);
+ printf("\n newReturnBB [" FMT_BB "] created\n", newReturnBB->bbNum);
}
#endif
BasicBlock* succ = curr->GetSucc(i, this);
if (succ != newBlock)
{
- JITDUMP("BB%02u previous predecessor was BB%02u, now is BB%02u\n", succ->bbNum, curr->bbNum,
+ JITDUMP(FMT_BB " previous predecessor was " FMT_BB ", now is " FMT_BB "\n", succ->bbNum, curr->bbNum,
newBlock->bbNum);
fgReplacePred(succ, curr, newBlock);
}
}
newBlock->bbFlags |= (curr->bbFlags & succ->bbFlags & (BBF_BACKWARD_JUMP));
- JITDUMP("Splitting edge from BB%02u to BB%02u; adding BB%02u\n", curr->bbNum, succ->bbNum, newBlock->bbNum);
+ JITDUMP("Splitting edge from " FMT_BB " to " FMT_BB "; adding " FMT_BB "\n", curr->bbNum, succ->bbNum,
+ newBlock->bbNum);
if (curr->bbJumpKind == BBJ_COND)
{
#ifdef DEBUG
if (verbose)
{
- printf("BB%02u was not imported, marked as removed (%d)\n", cur->bbNum, removedBlks);
+ printf(FMT_BB " was not imported, marked as removed (%d)\n", cur->bbNum, removedBlks);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Beginning of try block (BB%02u) not imported "
+ printf("Beginning of try block (" FMT_BB ") not imported "
"- remove index #%u from the EH table\n",
HBtab->ebdTryBeg->bbNum, XTnum + delCnt);
}
{
printf("\nRemoving statement ");
printTreeID(stmt);
- printf(" in BB%02u as useless:\n", block->bbNum);
+ printf(" in " FMT_BB " as useless:\n", block->bbNum);
gtDispTree(stmt);
}
#endif // DEBUG
{
if (block->bbTreeList == nullptr)
{
- printf("\nBB%02u becomes empty", block->bbNum);
+ printf("\n" FMT_BB " becomes empty", block->bbNum);
}
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("\nCompacting blocks BB%02u and BB%02u:\n", block->bbNum, bNext->bbNum);
+ printf("\nCompacting blocks " FMT_BB " and " FMT_BB ":\n", block->bbNum, bNext->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nRemoving unreachable BB%02u\n", block->bbNum);
+ printf("\nRemoving unreachable " FMT_BB "\n", block->bbNum);
}
#endif // DEBUG
block->bbJumpDest = nullptr;
if (verbose)
{
- printf("Block BB%02u becoming a BBJ_NONE to BB%02u (jump target is the same whether the condition is true or "
+ printf("Block " FMT_BB " becoming a BBJ_NONE to " FMT_BB
+ " (jump target is the same whether the condition is true or "
"false)\n",
block->bbNum, block->bbNext->bbNum);
}
// We had created an initial scratch BB, but now we're deleting it.
if (verbose)
{
- printf("Unlinking scratch BB%02u\n", block->bbNum);
+ printf("Unlinking scratch " FMT_BB "\n", block->bbNum);
}
#endif // DEBUG
fgFirstBBScratch = nullptr;
PREFIX_ASSUME(block != nullptr);
- JITDUMP("fgRemoveBlock BB%02u\n", block->bbNum);
+ JITDUMP("fgRemoveBlock " FMT_BB "\n", block->bbNum);
// If we've cached any mappings from switch blocks to SwitchDesc's (which contain only the
// *unique* successors of the switch block), invalidate that cache, since an entry in one of
#ifdef DEBUG
if (verbose)
{
- printf("Removing empty BB%02u\n", block->bbNum);
+ printf("Removing empty " FMT_BB "\n", block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Block BB%02u ended with a BBJ_NONE, Changed to an unconditional jump to BB%02u\n",
+ printf("Block " FMT_BB " ended with a BBJ_NONE, Changed to an unconditional jump to " FMT_BB
+ "\n",
bSrc->bbNum, bSrc->bbJumpDest->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("Added an unconditional jump to BB%02u after block BB%02u\n", jmpBlk->bbJumpDest->bbNum,
- bSrc->bbNum);
+ printf("Added an unconditional jump to " FMT_BB " after block " FMT_BB "\n",
+ jmpBlk->bbJumpDest->bbNum, bSrc->bbNum);
}
#endif // DEBUG
break;
#ifdef DEBUG
if (verbose)
{
- printf("Changed an unconditional jump from BB%02u to the next block BB%02u into a BBJ_NONE block\n",
+ printf("Changed an unconditional jump from " FMT_BB " to the next block " FMT_BB
+ " into a BBJ_NONE block\n",
bSrc->bbNum, bSrc->bbNext->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Renumber BB%02u to BB%02u\n", block->bbNum, num);
+ printf("Renumber " FMT_BB " to " FMT_BB "\n", block->bbNum, num);
}
#endif // DEBUG
block->bbNum = num;
assert(reason != nullptr);
if (verbose)
{
- printf("%s, marking BB%02u as rarely run\n", reason, bPrev->bbNum);
+ printf("%s, marking " FMT_BB " as rarely run\n", reason, bPrev->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("All branches to BB%02u are from rarely run blocks, marking as rarely run\n", block->bbNum);
+ printf("All branches to " FMT_BB " are from rarely run blocks, marking as rarely run\n",
+ block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Also marking the BBJ_ALWAYS at BB%02u as rarely run\n", bNext->bbNum);
+ printf("Also marking the BBJ_ALWAYS at " FMT_BB " as rarely run\n", bNext->bbNum);
}
#endif // DEBUG
}
#ifdef DEBUG
if (verbose)
{
- printf("Marking the BBJ_CALLFINALLY block at BB%02u as rarely run because BB%02u is rarely run\n",
+ printf("Marking the BBJ_CALLFINALLY block at " FMT_BB " as rarely run because " FMT_BB
+ " is rarely run\n",
bPrev->bbNum, block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Marking the BBJ_ALWAYS block at BB%02u as rarely run because BB%02u is rarely run\n",
+ printf("Marking the BBJ_ALWAYS block at " FMT_BB " as rarely run because " FMT_BB
+ " is rarely run\n",
block->bbNum, bPrev->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("Relocated block%s [BB%02u..BB%02u] inserted after BB%02u%s\n", (bStart == bEnd) ? "" : "s",
+ printf("Relocated block%s [" FMT_BB ".." FMT_BB "] inserted after " FMT_BB "%s\n", (bStart == bEnd) ? "" : "s",
bStart->bbNum, bEnd->bbNum, insertAfterBlk->bbNum,
(insertAfterBlk->bbNext == nullptr) ? " at the end of method" : "");
}
bPrev = bStart->bbPrev;
noway_assert(bPrev != nullptr); // Can't move a range that includes the first block of the function.
- JITDUMP("Relocating %s range BB%02u..BB%02u (EH#%u) to end of BBlist\n",
+ JITDUMP("Relocating %s range " FMT_BB ".." FMT_BB " (EH#%u) to end of BBlist\n",
(relocateType == FG_RELOCATE_TRY) ? "try" : "handler", bStart->bbNum, bLast->bbNum, regionIndex);
#ifdef DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("*************** Failed fgRelocateEHRange(BB%02u..BB%02u) because %s\n", bStart->bbNum, bLast->bbNum,
- reason);
+ printf("*************** Failed fgRelocateEHRange(" FMT_BB ".." FMT_BB ") because %s\n", bStart->bbNum,
+ bLast->bbNum, reason);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nCreating funclet prolog header for BB%02u\n", block->bbNum);
+ printf("\nCreating funclet prolog header for " FMT_BB "\n", block->bbNum);
}
#endif
{
if (bDst->bbPreds != nullptr)
{
- printf(" Edge weights into BB%02u :", bDst->bbNum);
+ printf(" Edge weights into " FMT_BB " :", bDst->bbNum);
for (edge = bDst->bbPreds; edge != nullptr; edge = edge->flNext)
{
bSrc = edge->flBlock;
// This is the control flow edge (bSrc -> bDst)
- printf("BB%02u ", bSrc->bbNum);
+ printf(FMT_BB " ", bSrc->bbNum);
if (edge->flEdgeWeightMin < BB_MAX_WEIGHT)
{
#ifdef DEBUG
if (verbose)
{
- printf("\nOptimizing a jump to an unconditional jump (BB%02u -> BB%02u -> BB%02u)\n", block->bbNum,
- bDest->bbNum, bDest->bbJumpDest->bbNum);
+ printf("\nOptimizing a jump to an unconditional jump (" FMT_BB " -> " FMT_BB " -> " FMT_BB ")\n",
+ block->bbNum, bDest->bbNum, bDest->bbJumpDest->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nKeeping empty block BB%02u - it is the target of a catch return\n", block->bbNum);
+ printf("\nKeeping empty block " FMT_BB " - it is the target of a catch return\n",
+ block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nOptimizing a switch jump to an empty block with an unconditional jump (BB%02u -> BB%02u "
- "-> BB%02u)\n",
+ printf("\nOptimizing a switch jump to an empty block with an unconditional jump (" FMT_BB
+ " -> " FMT_BB " "
+ "-> " FMT_BB ")\n",
block->bbNum, bDest->bbNum, bNewDest->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nRemoving a switch jump with a single target (BB%02u)\n", block->bbNum);
+ printf("\nRemoving a switch jump with a single target (" FMT_BB ")\n", block->bbNum);
printf("BEFORE:\n");
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nConverting a switch (BB%02u) with only one significant clause besides a default target to a "
+ printf("\nConverting a switch (" FMT_BB ") with only one significant clause besides a default target to a "
"conditional branch\n",
block->bbNum);
}
#ifdef DEBUG
if (verbose)
{
- printf("fgOptimizeUncondBranchToSimpleCond(from BB%02u to cond BB%02u), created new uncond BB%02u\n",
+ printf("fgOptimizeUncondBranchToSimpleCond(from " FMT_BB " to cond " FMT_BB "), created new uncond " FMT_BB
+ "\n",
block->bbNum, target->bbNum, next->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nRemoving unconditional jump to next block (BB%02u -> BB%02u) (converted BB%02u to "
+ printf("\nRemoving unconditional jump to next block (" FMT_BB " -> " FMT_BB
+ ") (converted " FMT_BB " to "
"fall-through)\n",
block->bbNum, bNext->bbNum, block->bbNum);
}
#ifdef DEBUG
if (verbose)
{
- printf("\nRemoving conditional jump to next block (BB%02u -> BB%02u)\n", block->bbNum, bNext->bbNum);
+ printf("\nRemoving conditional jump to next block (" FMT_BB " -> " FMT_BB ")\n", block->bbNum,
+ bNext->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nDuplication of the conditional block BB%02u (always branch from BB%02u) %s, because the cost of "
+ printf("\nDuplication of the conditional block " FMT_BB " (always branch from " FMT_BB
+ ") %s, because the cost of "
"duplication (%i) is %s than %i,"
" validProfileWeights = %s\n",
bDest->bbNum, bJump->bbNum, costIsTooHigh ? "not done" : "performed", estDupCostSz,
if (verbose)
{
// Dump out the newStmtList that we created
- printf("\nfgOptimizeBranch added these statements(s) at the end of BB%02u:\n", bJump->bbNum);
+ printf("\nfgOptimizeBranch added these statements(s) at the end of " FMT_BB ":\n", bJump->bbNum);
for (stmt = newStmtList->AsStmt(); stmt; stmt = stmt->gtNextStmt)
{
gtDispTree(stmt);
}
- printf("\nfgOptimizeBranch changed block BB%02u from BBJ_ALWAYS to BBJ_COND.\n", bJump->bbNum);
+ printf("\nfgOptimizeBranch changed block " FMT_BB " from BBJ_ALWAYS to BBJ_COND.\n", bJump->bbNum);
printf("\nAfter this change in fgOptimizeBranch the BB graph is:");
fgDispBasicBlocks(verboseTrees);
{
if (bPrev->bbJumpKind == BBJ_COND)
{
- printf("Decided to reverse conditional branch at block BB%02u branch to BB%02u ", bPrev->bbNum,
- bDest->bbNum);
+ printf("Decided to reverse conditional branch at block " FMT_BB " branch to " FMT_BB " ",
+ bPrev->bbNum, bDest->bbNum);
}
else if (bPrev->bbJumpKind == BBJ_ALWAYS)
{
- printf("Decided to straighten unconditional branch at block BB%02u branch to BB%02u ", bPrev->bbNum,
- bDest->bbNum);
+ printf("Decided to straighten unconditional branch at block " FMT_BB " branch to " FMT_BB " ",
+ bPrev->bbNum, bDest->bbNum);
}
else
{
- printf("Decided to place hot code after BB%02u, placed BB%02u after this block ", bPrev->bbNum,
- bDest->bbNum);
+ printf("Decided to place hot code after " FMT_BB ", placed " FMT_BB " after this block ",
+ bPrev->bbNum, bDest->bbNum);
}
if (profHotWeight > 0)
}
else
{
- printf("Decided to relocate block(s) after block BB%02u since they are %s block(s)\n", bPrev->bbNum,
+ printf("Decided to relocate block(s) after block " FMT_BB " since they are %s block(s)\n", bPrev->bbNum,
block->isRunRarely() ? "rarely run" : "uncommonly run");
}
}
{
if (bStart != bEnd)
{
- printf("Could not relocate blocks (BB%02u .. BB%02u)\n", bStart->bbNum, bEnd->bbNum);
+ printf("Could not relocate blocks (" FMT_BB " .. " FMT_BB ")\n", bStart->bbNum,
+ bEnd->bbNum);
}
else
{
- printf("Could not relocate block BB%02u\n", bStart->bbNum);
+ printf("Could not relocate block " FMT_BB "\n", bStart->bbNum);
}
}
#endif // DEBUG
printf("Relocated %s ", msg);
if (bStart != bEnd)
{
- printf("blocks (BB%02u .. BB%02u)", bStart->bbNum, bEnd->bbNum);
+ printf("blocks (" FMT_BB " .. " FMT_BB ")", bStart->bbNum, bEnd->bbNum);
}
else
{
- printf("block BB%02u", bStart->bbNum);
+ printf("block " FMT_BB, bStart->bbNum);
}
if (bPrev->bbJumpKind == BBJ_COND)
{
- printf(" by reversing conditional jump at BB%02u\n", bPrev->bbNum);
+ printf(" by reversing conditional jump at " FMT_BB "\n", bPrev->bbNum);
}
else
{
{
if (firstColdBlock)
{
- printf("fgFirstColdBlock is BB%02u.\n", firstColdBlock->bbNum);
+ printf("fgFirstColdBlock is " FMT_BB ".\n", firstColdBlock->bbNum);
}
else
{
#ifdef DEBUG
if (verbose)
{
- printf("\nReversing a conditional jump around an unconditional jump (BB%02u -> BB%02u -> "
- "BB%02u)\n",
+ printf("\nReversing a conditional jump around an unconditional jump (" FMT_BB " -> " FMT_BB
+ " -> " FMT_BB ")\n",
block->bbNum, bDest->bbNum, bNext->bbJumpDest->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: New first block of try: BB%02u\n", ehGetIndex(HBtab), bPrev->bbNum);
+ printf("EH#%u: New first block of try: " FMT_BB "\n", ehGetIndex(HBtab), bPrev->bbNum);
}
#endif // DEBUG
HBtab->ebdTryBeg = bPrev;
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: New first block of handler: BB%02u\n", ehGetIndex(HBtab), bPrev->bbNum);
+ printf("EH#%u: New first block of handler: " FMT_BB "\n", ehGetIndex(HBtab), bPrev->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: Updating bbJumpDest for filter ret block: BB%02u => BB%02u\n", ehGetIndex(HBtab),
- bFilterLast->bbNum, bPrev->bbNum);
+ printf("EH#%u: Updating bbJumpDest for filter ret block: " FMT_BB " => " FMT_BB "\n",
+ ehGetIndex(HBtab), bFilterLast->bbNum, bPrev->bbNum);
}
#endif // DEBUG
// Change the bbJumpDest for bFilterLast from the old first 'block' to the new first 'bPrev'
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: New first block of filter: BB%02u\n", ehGetIndex(HBtab), bPrev->bbNum);
+ printf("EH#%u: New first block of filter: " FMT_BB "\n", ehGetIndex(HBtab), bPrev->bbNum);
}
#endif // DEBUG
}
#endif // DEBUG
- JITDUMP("fgFindInsertPoint(regionIndex=%u, putInTryRegion=%s, startBlk=BB%02u, endBlk=BB%02u, nearBlk=BB%02u, "
- "jumpBlk=BB%02u, runRarely=%s)\n",
+ JITDUMP("fgFindInsertPoint(regionIndex=%u, putInTryRegion=%s, startBlk=" FMT_BB ", endBlk=" FMT_BB
+ ", nearBlk=" FMT_BB ", "
+ "jumpBlk=" FMT_BB ", runRarely=%s)\n",
regionIndex, dspBool(putInTryRegion), startBlk->bbNum, (endBlk == nullptr) ? 0 : endBlk->bbNum,
(nearBlk == nullptr) ? 0 : nearBlk->bbNum, (jumpBlk == nullptr) ? 0 : jumpBlk->bbNum, dspBool(runRarely));
noway_assert(afterBlk != nullptr);
JITDUMP("fgNewBBinRegion(jumpKind=%u, tryIndex=%u, hndIndex=%u, putInFilter=%s, runRarely=%s, insertAtEnd=%s): "
- "inserting after BB%02u\n",
+ "inserting after " FMT_BB "\n",
jumpKind, tryIndex, hndIndex, dspBool(putInFilter), dspBool(runRarely), dspBool(insertAtEnd),
afterBlk->bbNum);
#ifdef DEBUG
if (verbose)
{
- printf("*** Computing fgRngChkTarget for block BB%02u to stkDepth %d\n", block->bbNum, stkDepth);
+ printf("*** Computing fgRngChkTarget for block " FMT_BB " to stkDepth %d\n", block->bbNum, stkDepth);
if (!block->IsLIR())
{
gtDispTree(compCurStmt);
case BBJ_COND:
case BBJ_NONE:
assert(block->bbNext != nullptr);
- fprintf(fgxFile, " BB%02u -> BB%02u\n", block->bbNum, block->bbNext->bbNum);
+ fprintf(fgxFile, " " FMT_BB " -> " FMT_BB "\n", block->bbNum, block->bbNext->bbNum);
break;
default:
// These may or may not have an edge to the next block.
// Add a transparent edge to keep nodes ordered.
if (block->bbNext != nullptr)
{
- fprintf(fgxFile, " BB%02u -> BB%02u [arrowtail=none,color=transparent]\n", block->bbNum,
- block->bbNext->bbNum);
+ fprintf(fgxFile, " " FMT_BB " -> " FMT_BB " [arrowtail=none,color=transparent]\n",
+ block->bbNum, block->bbNext->bbNum);
}
}
}
{
continue;
}
- fprintf(fgxFile, " BB%02u -> BB%02u", bSource->bbNum, bTarget->bbNum);
+ fprintf(fgxFile, " " FMT_BB " -> " FMT_BB, bSource->bbNum, bTarget->bbNum);
if ((bSource->bbNum > bTarget->bbNum))
{
fprintf(fgxFile, "[arrowhead=normal,arrowtail=none,color=green]\n");
for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext)
{
- printf("BB%02u : ", block->bbNum);
+ printf(FMT_BB " : ", block->bbNum);
BlockSetOps::Iter iter(this, block->bbReach);
unsigned bbNum = 0;
while (iter.NextElem(&bbNum))
{
- printf("BB%02u ", bbNum);
+ printf(FMT_BB " ", bbNum);
}
printf("\n");
}
for (unsigned i = 1; i <= fgBBNumMax; ++i)
{
BasicBlock* current = fgBBInvPostOrder[i];
- printf("BB%02u: ", current->bbNum);
+ printf(FMT_BB ": ", current->bbNum);
while (current != current->bbIDom)
{
- printf("BB%02u ", current->bbNum);
+ printf(FMT_BB " ", current->bbNum);
current = current->bbIDom;
}
printf("\n");
switch (block->bbJumpKind)
{
case BBJ_COND:
- printf("-> BB%02u%*s ( cond )", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s ( cond )", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
break;
case BBJ_CALLFINALLY:
- printf("-> BB%02u%*s (callf )", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s (callf )", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
break;
case BBJ_ALWAYS:
if (flags & BBF_KEEP_BBJ_ALWAYS)
{
- printf("-> BB%02u%*s (ALWAYS)", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s (ALWAYS)", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
}
else
{
- printf("-> BB%02u%*s (always)", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s (always)", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
}
break;
case BBJ_LEAVE:
- printf("-> BB%02u%*s (leave )", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s (leave )", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
break;
break;
case BBJ_EHCATCHRET:
- printf("-> BB%02u%*s ( cret )", block->bbJumpDest->bbNum,
+ printf("-> " FMT_BB "%*s ( cret )", block->bbJumpDest->bbNum,
maxBlockNumWidth - max(CountDigits(block->bbJumpDest->bbNum), 2), "");
break;
switchWidth = 0;
do
{
- printf("%cBB%02u", (jumpTab == block->bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
+ printf("%c" FMT_BB, (jumpTab == block->bbJumpSwt->bbsDstTab) ? ' ' : ',', (*jumpTab)->bbNum);
switchWidth += 1 /* space/comma */ + 2 /* BB */ + max(CountDigits((*jumpTab)->bbNum), 2);
} while (++jumpTab, --jumpCnt);
{
compCurStmtNum++; // Increment the current stmtNum
- printf("\n***** BB%02u, stmt %d\n", bbNum, compCurStmtNum);
+ printf("\n***** " FMT_BB ", stmt %d\n", bbNum, compCurStmtNum);
if (fgOrder == FGOrderLinear || opts.compDbgInfo)
{
return true;
}
- printf("Jump into the middle of try region: BB%02u branches to BB%02u\n", blockPred->bbNum, block->bbNum);
+ printf("Jump into the middle of try region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum, block->bbNum);
assert(!"Jump into middle of try region");
return false;
}
return true;
}
- printf("Jump into the middle of handler region: BB%02u branches to BB%02u\n", blockPred->bbNum, block->bbNum);
+ printf("Jump into the middle of handler region: " FMT_BB " branches to " FMT_BB "\n", blockPred->bbNum,
+ block->bbNum);
assert(!"Jump into the middle of handler region");
return false;
}
#ifdef DEBUG
if (verbose)
{
- printf("\nConvert bbJumpKind of BB%02u to BBJ_ALWAYS to bottomBlock BB%02u\n", block->bbNum,
+ printf("\nConvert bbJumpKind of " FMT_BB " to BBJ_ALWAYS to bottomBlock " FMT_BB "\n", block->bbNum,
bottomBlock->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nConvert bbJumpKind of BB%02u to BBJ_NONE\n", block->bbNum);
+ printf("\nConvert bbJumpKind of " FMT_BB " to BBJ_NONE\n", block->bbNum);
}
#endif // DEBUG
block->bbJumpKind = BBJ_NONE;
BasicBlock* const leaveBlock = currentBlock->bbNext;
BasicBlock* const postTryFinallyBlock = leaveBlock->bbJumpDest;
- JITDUMP("Modifying callfinally BB%02u leave BB%02u finally BB%02u continuation BB%02u\n",
+ JITDUMP("Modifying callfinally " FMT_BB " leave " FMT_BB " finally " FMT_BB " continuation " FMT_BB
+ "\n",
currentBlock->bbNum, leaveBlock->bbNum, firstBlock->bbNum, postTryFinallyBlock->bbNum);
- JITDUMP("so that BB%02u jumps to BB%02u; then remove BB%02u\n", currentBlock->bbNum,
+ JITDUMP("so that " FMT_BB " jumps to " FMT_BB "; then remove " FMT_BB "\n", currentBlock->bbNum,
postTryFinallyBlock->bbNum, leaveBlock->bbNum);
noway_assert(leaveBlock->bbJumpKind == BBJ_ALWAYS);
currentBlock = nextBlock;
}
- JITDUMP("Remove now-unreachable handler BB%02u\n", firstBlock->bbNum);
+ JITDUMP("Remove now-unreachable handler " FMT_BB "\n", firstBlock->bbNum);
// Handler block should now be unreferenced, since the only
// explicit references to it were in call finallys.
// or branch to same.
if (!firstTryBlock->isEmpty())
{
- JITDUMP("EH#%u first try block BB%02u not empty; skipping.\n", XTnum, firstTryBlock->bbNum);
+ JITDUMP("EH#%u first try block " FMT_BB " not empty; skipping.\n", XTnum, firstTryBlock->bbNum);
XTnum++;
continue;
}
// pair that targets the finally
if (firstTryBlock->bbJumpKind != BBJ_ALWAYS)
{
- JITDUMP("EH#%u first try block BB%02u not jump to a callfinally; skipping.\n", XTnum, firstTryBlock->bbNum);
+ JITDUMP("EH#%u first try block " FMT_BB " not jump to a callfinally; skipping.\n", XTnum,
+ firstTryBlock->bbNum);
XTnum++;
continue;
}
// return.
if (!callFinally->isBBCallAlwaysPair() || (callFinally->bbJumpDest != firstHandlerBlock))
{
- JITDUMP("EH#%u first try block BB%02u always jumps but not to a callfinally; skipping.\n", XTnum,
+ JITDUMP("EH#%u first try block " FMT_BB " always jumps but not to a callfinally; skipping.\n", XTnum,
firstTryBlock->bbNum);
XTnum++;
continue;
// Try itself must be a single block.
if (firstTryBlock != lastTryBlock)
{
- JITDUMP("EH#%u first try block BB%02u not only block in try; skipping.\n", XTnum,
+ JITDUMP("EH#%u first try block " FMT_BB " not only block in try; skipping.\n", XTnum,
firstTryBlock->bbNext->bbNum);
XTnum++;
continue;
// finally doesn't return.
if (!firstTryBlock->isBBCallAlwaysPair() || (firstTryBlock->bbJumpDest != firstHandlerBlock))
{
- JITDUMP("EH#%u first try block BB%02u not a callfinally; skipping.\n", XTnum, firstTryBlock->bbNum);
+ JITDUMP("EH#%u first try block " FMT_BB " not a callfinally; skipping.\n", XTnum, firstTryBlock->bbNum);
XTnum++;
continue;
}
// Try must be a callalways pair of blocks.
if (firstTryBlock->bbNext != lastTryBlock)
{
- JITDUMP("EH#%u block BB%02u not last block in try; skipping.\n", XTnum, firstTryBlock->bbNext->bbNum);
+ JITDUMP("EH#%u block " FMT_BB " not last block in try; skipping.\n", XTnum, firstTryBlock->bbNext->bbNum);
XTnum++;
continue;
}
if (block != callFinally)
{
- JITDUMP("EH#%u found unexpected callfinally BB%02u; skipping.\n");
+ JITDUMP("EH#%u found unexpected callfinally " FMT_BB "; skipping.\n");
verifiedSingleCallfinally = false;
break;
}
// through from the try into the clone.
tryToRelocateCallFinally = true;
- JITDUMP("Chose path to clone: try block BB%02u jumps to callfinally at BB%02u;"
- " the call returns to BB%02u which jumps to BB%02u\n",
+ JITDUMP("Chose path to clone: try block " FMT_BB " jumps to callfinally at " FMT_BB ";"
+ " the call returns to " FMT_BB " which jumps to " FMT_BB "\n",
block->bbNum, jumpDest->bbNum, finallyReturnBlock->bbNum, postTryFinallyBlock->bbNum);
#else
- JITDUMP("Chose path to clone: try block BB%02u is a callfinally;"
- " the call returns to BB%02u which jumps to BB%02u\n",
+ JITDUMP("Chose path to clone: try block " FMT_BB " is a callfinally;"
+ " the call returns to " FMT_BB " which jumps to " FMT_BB "\n",
block->bbNum, finallyReturnBlock->bbNum, postTryFinallyBlock->bbNum);
#endif // FEATURE_EH_CALLFINALLY_THUNKS
continue;
}
- JITDUMP("Will update callfinally block BB%02u to jump to the clone;"
- " clone will jump to BB%02u\n",
+ JITDUMP("Will update callfinally block " FMT_BB " to jump to the clone;"
+ " clone will jump to " FMT_BB "\n",
normalCallFinallyBlock->bbNum, normalCallFinallyReturn->bbNum);
// If there are multiple callfinallys and we're in the
if ((placeToMoveAfter->bbJumpKind == BBJ_ALWAYS) &&
(placeToMoveAfter->bbJumpDest == normalCallFinallyBlock))
{
- JITDUMP("Moving callfinally BB%02u to be first in line, before BB%02u\n",
+ JITDUMP("Moving callfinally " FMT_BB " to be first in line, before " FMT_BB "\n",
normalCallFinallyBlock->bbNum, firstCallFinallyBlock->bbNum);
BasicBlock* const firstToMove = normalCallFinallyBlock;
}
else
{
- JITDUMP("Can't move callfinally BB%02u to be first in line"
- " -- last finally block BB%02u doesn't jump to it\n",
+ JITDUMP("Can't move callfinally " FMT_BB " to be first in line"
+ " -- last finally block " FMT_BB " doesn't jump to it\n",
normalCallFinallyBlock->bbNum, placeToMoveAfter->bbNum);
}
}
// We should have cloned all the finally region blocks.
assert(cloneBBCount == regionBBCount);
- JITDUMP("Cloned finally blocks are: BB%2u ... BB%2u\n", blockMap[firstBlock]->bbNum,
+ JITDUMP("Cloned finally blocks are: " FMT_BB " ... " FMT_BB "\n", blockMap[firstBlock]->bbNum,
blockMap[lastBlock]->bbNum);
// Redirect redirect any branches within the newly-cloned
{
// We can't retarget this call since it
// returns somewhere else.
- JITDUMP("Can't retarget callfinally in BB%02u as it jumps to BB%02u, not BB%02u\n",
+ JITDUMP("Can't retarget callfinally in " FMT_BB " as it jumps to " FMT_BB ", not " FMT_BB "\n",
currentBlock->bbNum, postTryFinallyBlock->bbNum, normalCallFinallyReturn->bbNum);
retargetedAllCalls = false;
if (!thisExitValid)
{
- JITDUMP("fgCheckTryFinallyExitS: EH#%u exit via BB%02u -> BB%02u is invalid\n", XTnum, block->bbNum,
- succBlock->bbNum);
+ JITDUMP("fgCheckTryFinallyExitS: EH#%u exit via " FMT_BB " -> " FMT_BB " is invalid\n", XTnum,
+ block->bbNum, succBlock->bbNum);
}
allTryExitsValid = allTryExitsValid & thisExitValid;
if ((continuation->bbFlags & BBF_FINALLY_TARGET) == 0)
{
- JITDUMP("Found callfinally BB%02u; setting finally target bit on BB%02u\n", block->bbNum,
+ JITDUMP("Found callfinally " FMT_BB "; setting finally target bit on " FMT_BB "\n", block->bbNum,
continuation->bbNum);
continuation->bbFlags |= BBF_FINALLY_TARGET;
// If the block already jumps to the canoncial call finally, no work needed.
if (block->bbJumpDest == canonicalCallFinally)
{
- JITDUMP("BB%02u already canonical\n", block->bbNum);
+ JITDUMP(FMT_BB " already canonical\n", block->bbNum);
return false;
}
// Else, retarget it so that it does...
- JITDUMP("Redirecting branch in BB%02u from BB%02u to BB%02u.\n", block->bbNum, callFinally->bbNum,
+ JITDUMP("Redirecting branch in " FMT_BB " from " FMT_BB " to " FMT_BB ".\n", block->bbNum, callFinally->bbNum,
canonicalCallFinally->bbNum);
block->bbJumpDest = canonicalCallFinally;
case GT_LABEL:
if (tree->gtLabel.gtLabBB)
{
- printf(" dst=BB%02u", tree->gtLabel.gtLabBB->bbNum);
+ printf(" dst=" FMT_BB, tree->gtLabel.gtLabBB->bbNum);
}
else
{
#ifdef DEBUG
if (verbose)
{
- JITDUMP("\nFound recursive call in the method. Mark BB%02u to BB%02u as having a backward branch.\n",
+ JITDUMP("\nFound recursive call in the method. Mark " FMT_BB " to " FMT_BB
+ " as having a backward branch.\n",
fgFirstBB->bbNum, compCurBB->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - BB%02u jumping out of catch handler EH#%u, adding call to "
+ printf("impImportLeave - " FMT_BB " jumping out of catch handler EH#%u, adding call to "
"CORINFO_HELP_ENDCATCH\n",
block->bbNum, XTnum);
}
#ifdef DEBUG
if (verbose)
{
- printf("\nBefore import CEE_LEAVE in BB%02u (targetting BB%02u):\n", block->bbNum, block->bbJumpDest->bbNum);
+ printf("\nBefore import CEE_LEAVE in " FMT_BB " (targetting " FMT_BB "):\n", block->bbNum,
+ block->bbJumpDest->bbNum);
fgDispBasicBlocks();
fgDispHandlerTab();
}
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - jumping out of a catch (EH#%u), convert block BB%02u to BBJ_EHCATCHRET "
+ printf("impImportLeave - jumping out of a catch (EH#%u), convert block " FMT_BB
+ " to BBJ_EHCATCHRET "
"block\n",
XTnum, step->bbNum);
}
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - jumping out of a catch (EH#%u), new BBJ_EHCATCHRET block BB%02u\n", XTnum,
- exitBlock->bbNum);
+ printf("impImportLeave - jumping out of a catch (EH#%u), new BBJ_EHCATCHRET block " FMT_BB "\n",
+ XTnum, exitBlock->bbNum);
}
#endif
}
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - jumping out of a finally-protected try (EH#%u), convert block BB%02u to "
- "BBJ_ALWAYS, add BBJ_CALLFINALLY block BB%02u\n",
+ printf("impImportLeave - jumping out of a finally-protected try (EH#%u), convert block " FMT_BB
+ " to "
+ "BBJ_ALWAYS, add BBJ_CALLFINALLY block " FMT_BB "\n",
XTnum, block->bbNum, callBlock->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - jumping out of a finally-protected try (EH#%u), convert block BB%02u to "
+ printf("impImportLeave - jumping out of a finally-protected try (EH#%u), convert block " FMT_BB
+ " to "
"BBJ_CALLFINALLY block\n",
XTnum, callBlock->bbNum);
}
if (verbose)
{
printf("impImportLeave - jumping out of a finally-protected try (EH#%u), step block is "
- "BBJ_EHCATCHRET (BB%02u), new BBJ_ALWAYS step-step block BB%02u\n",
+ "BBJ_EHCATCHRET (" FMT_BB "), new BBJ_ALWAYS step-step block " FMT_BB "\n",
XTnum, step->bbNum, step2->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - jumping out of a finally-protected try (EH#%u), new BBJ_CALLFINALLY block "
- "BB%02u\n",
+ printf("impImportLeave - jumping out of a finally-protected try (EH#%u), new BBJ_CALLFINALLY "
+ "block " FMT_BB "\n",
XTnum, callBlock->bbNum);
}
#endif
if (verbose)
{
printf("impImportLeave - jumping out of a finally-protected try (EH#%u), created step (BBJ_ALWAYS) "
- "block BB%02u\n",
+ "block " FMT_BB "\n",
XTnum, step->bbNum);
}
#endif
if (stepType == ST_FinallyReturn)
{
printf("impImportLeave - return from finally jumping out of a catch-protected try (EH#%u), new "
- "BBJ_ALWAYS block BB%02u\n",
+ "BBJ_ALWAYS block " FMT_BB "\n",
XTnum, catchStep->bbNum);
}
else
{
assert(stepType == ST_Catch);
printf("impImportLeave - return from catch jumping out of a catch-protected try (EH#%u), new "
- "BBJ_ALWAYS block BB%02u\n",
+ "BBJ_ALWAYS block " FMT_BB "\n",
XTnum, catchStep->bbNum);
}
}
if (verbose)
{
printf("impImportLeave - no enclosing finally-protected try blocks or catch handlers; convert CEE_LEAVE "
- "block BB%02u to BBJ_ALWAYS\n",
+ "block " FMT_BB " to BBJ_ALWAYS\n",
block->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("impImportLeave - final destination of step blocks set to BB%02u\n", leaveTarget->bbNum);
+ printf("impImportLeave - final destination of step blocks set to " FMT_BB "\n", leaveTarget->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("New Basic Block BB%02u duplicate of BB%02u created.\n", dupBlock->bbNum, block->bbNum);
+ printf("New Basic Block " FMT_BB " duplicate of " FMT_BB " created.\n", dupBlock->bbNum, block->bbNum);
}
#endif
}
if (verbose)
{
- printf("\nImporting BB%02u (PC=%03u) of '%s'", block->bbNum, block->bbCodeOffs, info.compFullName);
+ printf("\nImporting " FMT_BB " (PC=%03u) of '%s'", block->bbNum, block->bbCodeOffs, info.compFullName);
}
#endif
{
if (op1->gtIntCon.gtIconVal)
{
- printf("\nThe conditional jump becomes an unconditional jump to BB%02u\n",
+ printf("\nThe conditional jump becomes an unconditional jump to " FMT_BB "\n",
block->bbJumpDest->bbNum);
}
else
{
- printf("\nThe block falls through into the next BB%02u\n", block->bbNext->bbNum);
+ printf("\nThe block falls through into the next " FMT_BB "\n", block->bbNext->bbNum);
}
}
#endif
#ifdef DEBUG
if (verbose && (block->bbFlags & BBF_IMPORTED))
{
- printf("\nBB%02u will be reimported\n", block->bbNum);
+ printf("\n" FMT_BB " will be reimported\n", block->bbNum);
}
#endif
// to mark them as imported and put their successors on the pending import list.
if (block->bbFlags & BBF_INTERNAL)
{
- JITDUMP("Marking BBF_INTERNAL block BB%02u as BBF_IMPORTED\n", block->bbNum);
+ JITDUMP("Marking BBF_INTERNAL block " FMT_BB " as BBF_IMPORTED\n", block->bbNum);
block->bbFlags |= BBF_IMPORTED;
const unsigned numSuccs = block->NumSucc();
#ifdef DEBUG
if (verbose)
{
- printf("\nimpImportBlockPending for BB%02u\n", block->bbNum);
+ printf("\nimpImportBlockPending for " FMT_BB "\n", block->bbNum);
}
#endif
{
addToPending = true;
- JITDUMP("Adding BB%02u to pending set due to new merge result\n", block->bbNum);
+ JITDUMP("Adding " FMT_BB " to pending set due to new merge result\n", block->bbNum);
}
}
#ifdef DEBUG
if (verbose && 0)
{
- printf("Added PendingDsc - %08p for BB%02u\n", dspPtr(dsc), block->bbNum);
+ printf("Added PendingDsc - %08p for " FMT_BB "\n", dspPtr(dsc), block->bbNum);
}
#endif
}
void Compiler::impReimportBlockPending(BasicBlock* block)
{
- JITDUMP("\nimpReimportBlockPending for BB%02u", block->bbNum);
+ JITDUMP("\nimpReimportBlockPending for " FMT_BB, block->bbNum);
assert(block->bbFlags & BBF_IMPORTED);
#ifdef DEBUG
if (verbose && 0)
{
- printf("Added PendingDsc - %08p for BB%02u\n", dspPtr(dsc), block->bbNum);
+ printf("Added PendingDsc - %08p for " FMT_BB "\n", dspPtr(dsc), block->bbNum);
}
#endif
}
#ifdef DEBUG
if (verbose)
{
- printf("\n*************** In impGetSpillTmpBase(BB%02u)\n", block->bbNum);
+ printf("\n*************** In impGetSpillTmpBase(" FMT_BB ")\n", block->bbNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\n*************** In impReimportSpillClique(BB%02u)\n", block->bbNum);
+ printf("\n*************** In impReimportSpillClique(" FMT_BB ")\n", block->bbNum);
}
#endif // DEBUG
{
// Treat these as imported.
assert(method->bbJumpKind == BBJ_NONE); // We assume all the leading ones are fallthrough.
- JITDUMP("Marking leading BBF_INTERNAL block BB%02u as BBF_IMPORTED\n", method->bbNum);
+ JITDUMP("Marking leading BBF_INTERNAL block " FMT_BB " as BBF_IMPORTED\n", method->bbNum);
method->bbFlags |= BBF_IMPORTED;
}
////////////// Protected (try) region
//////////////
- printf("- Try at BB%02u..BB%02u", ebdTryBeg->bbNum, ebdTryLast->bbNum);
+ printf("- Try at " FMT_BB ".." FMT_BB, ebdTryBeg->bbNum, ebdTryLast->bbNum);
/* ( brace matching editor workaround to compensate for the following line */
printf(" [%03X..%03X), ", ebdTryBegOffset, ebdTryEndOffset);
if (HasFilter())
{
/* ( brace matching editor workaround to compensate for the following line */
- printf("Filter at BB%02u..BB%02u [%03X..%03X), ", ebdFilter->bbNum, BBFilterLast()->bbNum, ebdFilterBegOffset,
- ebdHndBegOffset);
+ printf("Filter at " FMT_BB ".." FMT_BB " [%03X..%03X), ", ebdFilter->bbNum, BBFilterLast()->bbNum,
+ ebdFilterBegOffset, ebdHndBegOffset);
}
//////////////
printf("Handler");
}
- printf(" at BB%02u..BB%02u", ebdHndBeg->bbNum, ebdHndLast->bbNum);
+ printf(" at " FMT_BB ".." FMT_BB, ebdHndBeg->bbNum, ebdHndLast->bbNum);
/* ( brace matching editor workaround to compensate for the following line */
printf(" [%03X..%03X)", ebdHndBegOffset, ebdHndEndOffset);
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: New last block of try: BB%02u\n", ehGetIndex(handlerTab), newTryLast->bbNum);
+ printf("EH#%u: New last block of try: " FMT_BB "\n", ehGetIndex(handlerTab), newTryLast->bbNum);
}
#endif // DEBUG
}
#ifdef DEBUG
if (verbose)
{
- printf("EH#%u: New last block of handler: BB%02u\n", ehGetIndex(handlerTab), newHndLast->bbNum);
+ printf("EH#%u: New last block of handler: " FMT_BB "\n", ehGetIndex(handlerTab), newHndLast->bbNum);
}
#endif // DEBUG
}
#ifdef DEBUG
if (verbose)
{
- printf("Handler begin for EH#%02u and 'try' begin for EH%02u are the same block; inserted new BB%02u "
- "before BB%02u as new handler begin for EH#%u.\n",
+ printf("Handler begin for EH#%02u and 'try' begin for EH%02u are the same block; inserted new " FMT_BB
+ " "
+ "before " FMT_BB " as new handler begin for EH#%u.\n",
XTnum, ehGetIndex(handlerStartContainingTry), newHndStart->bbNum, eh->ebdHndBeg->bbNum, XTnum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("'try' begin for EH#%u and EH#%u are same block; inserted new BB%02u before BB%02u "
+ printf("'try' begin for EH#%u and EH#%u are same block; inserted new " FMT_BB
+ " before " FMT_BB " "
"as new 'try' begin for EH#%u.\n",
ehOuterTryIndex, XTnum, newTryStart->bbNum, insertBeforeBlk->bbNum, ehOuterTryIndex);
}
#ifdef DEBUG
if (verbose)
{
- printf("Redirect BB%02u target from BB%02u to BB%02u.\n", predBlock->bbNum,
- insertBeforeBlk->bbNum, newTryStart->bbNum);
+ printf("Redirect " FMT_BB " target from " FMT_BB " to " FMT_BB ".\n",
+ predBlock->bbNum, insertBeforeBlk->bbNum, newTryStart->bbNum);
}
#endif // DEBUG
}
#ifdef DEBUG
if (verbose)
{
- printf("last %s block for EH#%u and last %s block for EH#%u are same block; inserted new "
- "BB%02u after BB%02u as new last %s block for EH#%u.\n",
- outerType, ehOuterIndex, innerType, ehInnerIndex, newLast->bbNum, insertAfterBlk->bbNum,
- outerType, ehOuterIndex);
+ printf(
+ "last %s block for EH#%u and last %s block for EH#%u are same block; inserted new " FMT_BB
+ " after " FMT_BB " as new last %s block for EH#%u.\n",
+ outerType, ehOuterIndex, innerType, ehInnerIndex, newLast->bbNum, insertAfterBlk->bbNum,
+ outerType, ehOuterIndex);
}
#endif // DEBUG
{
if (blockNumMap[i] != 0)
{
- printf("BB%02u => BB%02u\n", i, blockNumMap[i]);
+ printf(FMT_BB " => " FMT_BB "\n", i, blockNumMap[i]);
}
}
}
}
};
- JITDUMP("\n*** %s local variables in block BB%02u (weight=%s)\n", isRecompute ? "recomputing" : "marking",
+ JITDUMP("\n*** %s local variables in block " FMT_BB " (weight=%s)\n", isRecompute ? "recomputing" : "marking",
block->bbNum, refCntWtd2str(block->getBBWeight(this)));
for (GenTreeStmt* stmt = block->FirstNonPhiDef(); stmt != nullptr; stmt = stmt->getNextStmt())
if (verbose)
{
VARSET_TP allVars(VarSetOps::Union(this, fgCurUseSet, fgCurDefSet));
- printf("BB%02u", block->bbNum);
+ printf(FMT_BB, block->bbNum);
printf(" USE(%d)=", VarSetOps::Count(this, fgCurUseSet));
lvaDispVarSet(fgCurUseSet, allVars);
for (MemoryKind memoryKind : allMemoryKinds())
#ifdef DEBUG
if (verbose)
{
- printf("Scope info: block BB%02u marking in scope: ", block->bbNum);
+ printf("Scope info: block " FMT_BB " marking in scope: ", block->bbNum);
dumpConvertedVarSet(this, inScope);
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("Scope info: block BB%02u UNmarking in scope: ", block->bbNum);
+ printf("Scope info: block " FMT_BB " UNmarking in scope: ", block->bbNum);
dumpConvertedVarSet(this, unmarkScope);
printf("\n");
}
BasicBlock* block;
for (block = fgFirstBB; block; block = block->bbNext)
{
- printf("BB%02u: ", block->bbNum);
+ printf(FMT_BB ": ", block->bbNum);
dumpConvertedVarSet(this, block->bbScope);
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("Created zero-init of V%02u in BB%02u\n", varNum, block->bbNum);
+ printf("Created zero-init of V%02u in " FMT_BB "\n", varNum, block->bbNum);
}
#endif // DEBUG
block->bbFlags |= BBF_CHANGED; // indicates that the contents of the block have changed.
#ifdef DEBUG
if (m_compiler->verbose)
{
- printf("Scope info: block BB%02u LiveIn+ ", block->bbNum);
+ printf("Scope info: block " FMT_BB " LiveIn+ ", block->bbNum);
dumpConvertedVarSet(m_compiler, VarSetOps::Diff(m_compiler, m_liveIn, block->bbLiveIn));
printf(", LiveOut+ ");
dumpConvertedVarSet(m_compiler, VarSetOps::Diff(m_compiler, m_liveOut, block->bbLiveOut));
#ifdef DEBUG
if (verbose)
{
- printf("BB%02u - Dead assignment has side effects...\n", compCurBB->bbNum);
+ printf(FMT_BB " - Dead assignment has side effects...\n", compCurBB->bbNum);
gtDispTree(asgNode);
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("BB%02u - INTERIOR dead assignment has side effects...\n", compCurBB->bbNum);
+ printf(FMT_BB " - INTERIOR dead assignment has side effects...\n", compCurBB->bbNum);
gtDispTree(asgNode);
printf("\n");
}
{
printf("\nRemoving tree ");
printTreeID(asgNode);
- printf(" in BB%02u as useless\n", compCurBB->bbNum);
+ printf(" in " FMT_BB " as useless\n", compCurBB->bbNum);
gtDispTree(asgNode);
printf("\n");
}
void Compiler::fgDispBBLiveness(BasicBlock* block)
{
VARSET_TP allVars(VarSetOps::Union(this, block->bbLiveIn, block->bbLiveOut));
- printf("BB%02u", block->bbNum);
+ printf(FMT_BB, block->bbNum);
printf(" IN (%d)=", VarSetOps::Count(this, block->bbLiveIn));
lvaDispVarSet(block->bbLiveIn, allVars);
for (MemoryKind memoryKind : allMemoryKinds())
}
#endif
- JITDUMP("Lowering switch BB%02u, %d cases\n", originalSwitchBB->bbNum, jumpCnt);
+ JITDUMP("Lowering switch " FMT_BB ", %d cases\n", originalSwitchBB->bbNum, jumpCnt);
// Handle a degenerate case: if the switch has only a default case, just convert it
// to an unconditional branch. This should only happen in minopts or with debuggable
// code.
if (targetCnt == 1)
{
- JITDUMP("Lowering switch BB%02u: single target; converting to BBJ_ALWAYS\n", originalSwitchBB->bbNum);
+ JITDUMP("Lowering switch " FMT_BB ": single target; converting to BBJ_ALWAYS\n", originalSwitchBB->bbNum);
noway_assert(comp->opts.MinOpts() || comp->opts.compDbgCode);
if (originalSwitchBB->bbNext == jumpTab[0])
{
// a statement that is responsible for performing a comparison of the table index and conditional
// branch if equal.
- JITDUMP("Lowering switch BB%02u: using compare/branch expansion\n", originalSwitchBB->bbNum);
+ JITDUMP("Lowering switch " FMT_BB ": using compare/branch expansion\n", originalSwitchBB->bbNum);
// We'll use 'afterDefaultCondBlock' for the first conditional. After that, we'll add new
// blocks. If we end up not needing it at all (say, if all the non-default cases just fall through),
// All the cases were fall-through! We don't need this block.
// Convert it from BBJ_SWITCH to BBJ_NONE and unset the BBF_DONT_REMOVE flag
// so fgRemoveBlock() doesn't complain.
- JITDUMP("Lowering switch BB%02u: all switch cases were fall-through\n", originalSwitchBB->bbNum);
+ JITDUMP("Lowering switch " FMT_BB ": all switch cases were fall-through\n", originalSwitchBB->bbNum);
assert(currentBlock == afterDefaultCondBlock);
assert(currentBlock->bbJumpKind == BBJ_SWITCH);
currentBlock->bbJumpKind = BBJ_NONE;
// if that's not possible a jump table based switch will be generated.
if (!TryLowerSwitchToBitTest(jumpTab, jumpCnt, targetCnt, afterDefaultCondBlock, switchValue))
{
- JITDUMP("Lowering switch BB%02u: using jump table expansion\n", originalSwitchBB->bbNum);
+ JITDUMP("Lowering switch " FMT_BB ": using jump table expansion\n", originalSwitchBB->bbNum);
#ifdef _TARGET_64BIT_
if (tempLclType != TYP_I_IMPL)
void LinearScan::dumpInVarToRegMap(BasicBlock* block)
{
- printf("Var=Reg beg of BB%02u: ", block->bbNum);
+ printf("Var=Reg beg of " FMT_BB ": ", block->bbNum);
VarToRegMap map = getInVarToRegMap(block->bbNum);
dumpVarToRegMap(map);
}
void LinearScan::dumpOutVarToRegMap(BasicBlock* block)
{
- printf("Var=Reg end of BB%02u: ", block->bbNum);
+ printf("Var=Reg end of " FMT_BB ": ", block->bbNum);
VarToRegMap map = getOutVarToRegMap(block->bbNum);
dumpVarToRegMap(map);
}
int i = 1;
for (BasicBlock *block = startBlockSequence(); block != nullptr; ++i, block = moveToNextBlock())
{
- JITDUMP("BB%02u", block->bbNum);
+ JITDUMP(FMT_BB, block->bbNum);
if (block->isMaxBBWeight())
{
{
return;
}
- JITDUMP("Recording Var Locations at start of BB%02u\n", bb->bbNum);
+ JITDUMP("Recording Var Locations at start of " FMT_BB "\n", bb->bbNum);
VarToRegMap map = getInVarToRegMap(bb->bbNum);
unsigned count = 0;
{
if (VERBOSE)
{
- JITDUMP("\n\nCHECKING LAST USES for block %u, liveout=", block->bbNum);
+ JITDUMP("\n\nCHECKING LAST USES for " FMT_BB ", liveout=", block->bbNum);
dumpConvertedVarSet(compiler, block->bbLiveOut);
JITDUMP("\n==============================\n");
}
unsigned varNum = compiler->lvaTrackedToVarNum[liveInNotComputedLiveIndex];
if (compiler->lvaTable[varNum].lvLRACandidate)
{
- JITDUMP("BB%02u: V%02u is in LiveIn set, but not computed live.\n", block->bbNum, varNum);
+ JITDUMP(FMT_BB ": V%02u is in LiveIn set, but not computed live.\n", block->bbNum, varNum);
foundDiff = true;
}
}
unsigned varNum = compiler->lvaTrackedToVarNum[computedLiveNotLiveInIndex];
if (compiler->lvaTable[varNum].lvLRACandidate)
{
- JITDUMP("BB%02u: V%02u is computed live, but not in LiveIn set.\n", block->bbNum, varNum);
+ JITDUMP(FMT_BB ": V%02u is computed live, but not in LiveIn set.\n", block->bbNum, varNum);
foundDiff = true;
}
}
printf("Prior to Resolution\n");
foreach_block(compiler, block)
{
- printf("\nBB%02u use def in out\n", block->bbNum);
+ printf("\n" FMT_BB " use def in out\n", block->bbNum);
dumpConvertedVarSet(compiler, block->bbVarUse);
printf("\n");
dumpConvertedVarSet(compiler, block->bbVarDef);
{
insertionPointString = "bottom";
}
- printf(" BB%02u %s: swap V%02u in %s with V%02u in %s\n", block->bbNum, insertionPointString, lclNum1,
+ printf(" " FMT_BB " %s: swap V%02u in %s with V%02u in %s\n", block->bbNum, insertionPointString, lclNum1,
getRegName(reg1), lclNum2, getRegName(reg2));
}
#endif // DEBUG
#endif // DEBUG
}
- JITDUMP(" BB%02u %s: move V%02u from ", block->bbNum, insertionPointString, interval->varNum);
+ JITDUMP(" " FMT_BB " %s: move V%02u from ", block->bbNum, insertionPointString, interval->varNum);
JITDUMP("%s to %s", getRegName(fromReg), getRegName(toReg));
insertMove(block, insertionPoint, interval->varNum, fromReg, toReg);
printf("Found mismatched var locations after resolution!\n");
}
unsigned varNum = compiler->lvaTrackedToVarNum[varIndex];
- printf(" V%02u: BB%02u to BB%02u: %s to %s\n", varNum, predBlock->bbNum, block->bbNum,
+ printf(" V%02u: " FMT_BB " to " FMT_BB ": %s to %s\n", varNum, predBlock->bbNum, block->bbNum,
getRegName(fromReg), getRegName(toReg));
}
}
if (spillCount != 0 || copyRegCount != 0 || resolutionMovCount != 0 || splitEdgeCount != 0)
{
- fprintf(file, "BB%02u [%8d]: ", block->bbNum, block->bbWeight);
+ fprintf(file, FMT_BB " [%8d]: ", block->bbNum, block->bbWeight);
fprintf(file, "SpillCount = %d, ResolutionMovs = %d, SplitEdges = %d, CopyReg = %d\n", spillCount,
resolutionMovCount, splitEdgeCount, copyRegCount);
}
{
printf("%s ", treeNode->OpName(treeNode->OperGet()));
}
- printf("BB%02u ", this->bbNum);
+ printf(FMT_BB " ", this->bbNum);
printf("regmask=");
dumpRegMask(registerAssignment);
if (enregisterLocalVars && mode == LSRA_DUMP_POST && block != compiler->fgFirstBB &&
block->bbNum <= bbNumMaxBeforeResolution)
{
- printf("Predecessor for variable locations: BB%02u\n", blockInfo[block->bbNum].predBBNum);
+ printf("Predecessor for variable locations: " FMT_BB "\n", blockInfo[block->bbNum].predBBNum);
dumpInVarToRegMap(block);
}
if (block->bbNum > bbNumMaxBeforeResolution)
splitBBNumToTargetBBNumMap->Lookup(block->bbNum, &splitEdgeInfo);
assert(splitEdgeInfo.toBBNum <= bbNumMaxBeforeResolution);
assert(splitEdgeInfo.fromBBNum <= bbNumMaxBeforeResolution);
- printf("New block introduced for resolution from BB%02u to BB%02u\n", splitEdgeInfo.fromBBNum,
+ printf("New block introduced for resolution from " FMT_BB " to " FMT_BB "\n", splitEdgeInfo.fromBBNum,
splitEdgeInfo.toBBNum);
}
printf("-----------------\n");
foreach_block(compiler, block)
{
- printf("BB%02u use def in out\n", block->bbNum);
+ printf(FMT_BB " use def in out\n", block->bbNum);
dumpConvertedVarSet(compiler, block->bbVarUse);
printf("\n");
dumpConvertedVarSet(compiler, block->bbVarDef);
for (block = startBlockSequence(); block != nullptr; block = moveToNextBlock())
{
- JITDUMP("\nNEW BLOCK BB%02u\n", block->bbNum);
+ JITDUMP("\nNEW BLOCK " FMT_BB "\n", block->bbNum);
bool predBlockIsAllocated = false;
predBlock = findPredBlockForLiveIn(block, prevBlock DEBUGARG(&predBlockIsAllocated));
if (predBlock)
{
- JITDUMP("\n\nSetting BB%02u as the predecessor for determining incoming variable registers of BB%02u\n",
+ JITDUMP("\n\nSetting " FMT_BB " as the predecessor for determining incoming variable registers of " FMT_BB
+ "\n",
block->bbNum, predBlock->bbNum);
assert(predBlock->bbNum <= bbNumMaxBeforeResolution);
blockInfo[block->bbNum].predBBNum = predBlock->bbNum;
{
printf("Expanding INLINE_CANDIDATE in statement ");
printTreeID(fgMorphStmt);
- printf(" in BB%02u:\n", compCurBB->bbNum);
+ printf(" in " FMT_BB ":\n", compCurBB->bbNum);
gtDispTree(fgMorphStmt);
if (call->IsImplicitTailCall())
{
#ifdef DEBUG
if (verbose)
{
- printf("\nConditional folded at BB%02u\n", block->bbNum);
- printf("BB%02u becomes a BBJ_THROW\n", block->bbNum);
+ printf("\nConditional folded at " FMT_BB "\n", block->bbNum);
+ printf(FMT_BB " becomes a BBJ_THROW\n", block->bbNum);
}
#endif
goto DONE_COND;
#ifdef DEBUG
if (verbose)
{
- printf("\nConditional folded at BB%02u\n", block->bbNum);
- printf("BB%02u becomes a %s", block->bbNum,
+ printf("\nConditional folded at " FMT_BB "\n", block->bbNum);
+ printf(FMT_BB " becomes a %s", block->bbNum,
block->bbJumpKind == BBJ_ALWAYS ? "BBJ_ALWAYS" : "BBJ_NONE");
if (block->bbJumpKind == BBJ_ALWAYS)
{
- printf(" to BB%02u", block->bbJumpDest->bbNum);
+ printf(" to " FMT_BB, block->bbJumpDest->bbNum);
}
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("Removing loop L%02u (from BB%02u to BB%02u)\n\n", loopNum,
+ printf("Removing loop L%02u (from " FMT_BB " to " FMT_BB ")\n\n", loopNum,
optLoopTable[loopNum].lpFirst->bbNum, optLoopTable[loopNum].lpBottom->bbNum);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nConditional folded at BB%02u\n", block->bbNum);
- printf("BB%02u becomes a BBJ_THROW\n", block->bbNum);
+ printf("\nConditional folded at " FMT_BB "\n", block->bbNum);
+ printf(FMT_BB " becomes a BBJ_THROW\n", block->bbNum);
}
#endif
goto DONE_SWITCH;
#ifdef DEBUG
if (verbose)
{
- printf("\nConditional folded at BB%02u\n", block->bbNum);
- printf("BB%02u becomes a %s", block->bbNum,
+ printf("\nConditional folded at " FMT_BB "\n", block->bbNum);
+ printf(FMT_BB " becomes a %s", block->bbNum,
block->bbJumpKind == BBJ_ALWAYS ? "BBJ_ALWAYS" : "BBJ_NONE");
if (block->bbJumpKind == BBJ_ALWAYS)
{
- printf(" to BB%02u", block->bbJumpDest->bbNum);
+ printf(" to " FMT_BB, block->bbJumpDest->bbNum);
}
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("\n%s Block BB%02u becomes a throw block.\n", msg, block->bbNum);
+ printf("\n%s Block " FMT_BB " becomes a throw block.\n", msg, block->bbNum);
}
#endif
fgRemoveRestOfBlock = false;
if (verbose)
{
- printf("\nfgMorphTree BB%02u, stmt %d (before)\n", block->bbNum, compCurStmtNum);
+ printf("\nfgMorphTree " FMT_BB ", stmt %d (before)\n", block->bbNum, compCurStmtNum);
gtDispTree(tree);
}
#endif
unsigned newHash = gtHashValue(morph);
if (newHash != oldHash)
{
- printf("\nfgMorphTree BB%02u, stmt %d (after)\n", block->bbNum, compCurStmtNum);
+ printf("\nfgMorphTree " FMT_BB ", stmt %d (after)\n", block->bbNum, compCurStmtNum);
gtDispTree(morph);
}
}
#ifdef DEBUG
if (verbose)
{
- printf("\nMorphing BB%02u of '%s'\n", block->bbNum, info.compFullName);
+ printf("\nMorphing " FMT_BB " of '%s'\n", block->bbNum, info.compFullName);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("morph BB%02u to point at onereturn. New block is\n", block->bbNum);
+ printf("morph " FMT_BB " to point at onereturn. New block is\n", block->bbNum);
fgTableDispBasicBlock(block);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nExpanding CastInstOf qmark in BB%02u (before)\n", block->bbNum);
+ printf("\nExpanding CastInstOf qmark in " FMT_BB " (before)\n", block->bbNum);
fgDispBasicBlocks(block, block, true);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nExpanding CastInstOf qmark in BB%02u (after)\n", block->bbNum);
+ printf("\nExpanding CastInstOf qmark in " FMT_BB " (after)\n", block->bbNum);
fgDispBasicBlocks(block, remainderBlock, true);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nExpanding top-level qmark in BB%02u (before)\n", block->bbNum);
+ printf("\nExpanding top-level qmark in " FMT_BB " (before)\n", block->bbNum);
fgDispBasicBlocks(block, block, true);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\nExpanding top-level qmark in BB%02u (after)\n", block->bbNum);
+ printf("\nExpanding top-level qmark in " FMT_BB " (after)\n", block->bbNum);
fgDispBasicBlocks(block, remainderBlock, true);
}
#endif // DEBUG
if (verbose)
{
printf("\nFound contiguous assignments from a SIMD vector to memory.\n");
- printf("From BB%02u, stmt", block->bbNum);
+ printf("From " FMT_BB ", stmt", block->bbNum);
printTreeID(stmt);
printf(" to stmt");
printTreeID(lastStmt);
#ifdef DEBUG
if (verbose)
{
- printf("\nBB%02u stmt", block->bbNum);
+ printf("\n" FMT_BB " stmt", block->bbNum);
printTreeID(stmt);
printf("(before)\n");
gtDispTree(stmt);
#ifdef DEBUG
if (verbose)
{
- printf("\nReplaced BB%02u stmt", block->bbNum);
+ printf("\nReplaced " FMT_BB " stmt", block->bbNum);
printTreeID(stmt);
printf("(after)\n");
gtDispTree(stmt);
EXPSET_TP tempMask = BitVecOps::MakeSingleton(cseTraits, genCSEnum2bit(CSEindex));
printf("\nCSE candidate #%02u, vn=", CSEindex);
vnPrint(vnlib, 0);
- printf(" cseMask=%s in BB%02u, [cost=%2u, size=%2u]: \n", genES2str(cseTraits, tempMask), compCurBB->bbNum,
- tree->gtCostEx, tree->gtCostSz);
+ printf(" cseMask=%s in " FMT_BB ", [cost=%2u, size=%2u]: \n", genES2str(cseTraits, tempMask),
+ compCurBB->bbNum, tree->gtCostEx, tree->gtCostSz);
gtDispTree(tree);
}
#endif // DEBUG
printf("\nBlocks that generate CSE def/uses\n");
headerPrinted = true;
}
- printf("BB%02u", block->bbNum);
+ printf(FMT_BB, block->bbNum);
printf(" cseGen = %s\n", genES2str(cseTraits, block->bbCseGen));
}
}
for (BasicBlock* block = fgFirstBB; block; block = block->bbNext)
{
- printf("BB%02u", block->bbNum);
+ printf(FMT_BB, block->bbNum);
printf(" cseIn = %s", genES2str(cseTraits, block->bbCseIn));
printf(" cseOut = %s", genES2str(cseTraits, block->bbCseOut));
printf("\n");
#ifdef DEBUG
if (verbose && IS_CSE_INDEX(tree->gtCSEnum))
{
- printf("BB%02u ", block->bbNum);
+ printf(FMT_BB " ", block->bbNum);
printTreeID(tree);
printf(" %s of CSE #%02u [weight=%s]\n", IS_CSE_USE(tree->gtCSEnum) ? "Use" : "Def",
GET_CSE_INDEX(tree->gtCSEnum), refCntWtd2str(stmw));
{
printf("\nWorking on the replacement of the CSE #%02u use at ", exp->gtCSEnum);
Compiler::printTreeID(exp);
- printf(" in BB%02u\n", blk->bbNum);
+ printf(" in " FMT_BB "\n", blk->bbNum);
}
#endif // DEBUG
{
printf("\nCSE #%02u use at ", exp->gtCSEnum);
Compiler::printTreeID(exp);
- printf(" replaced in BB%02u with temp use.\n", blk->bbNum);
+ printf(" replaced in " FMT_BB " with temp use.\n", blk->bbNum);
}
#endif // DEBUG
// If we have any side effects or extracted CSE defs then we need to create a GT_COMMA tree instead
{
printf("\nCSE #%02u def at ", GET_CSE_INDEX(exp->gtCSEnum));
Compiler::printTreeID(exp);
- printf(" replaced in BB%02u with def of V%02u\n", blk->bbNum, cseLclVarNum);
+ printf(" replaced in " FMT_BB " with def of V%02u\n", blk->bbNum, cseLclVarNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf("\n BB%02u(wt=%s)", curBlk->bbNum, refCntWtd2str(curBlk->getBBWeight(this)));
+ printf("\n " FMT_BB "(wt=%s)", curBlk->bbNum, refCntWtd2str(curBlk->getBBWeight(this)));
}
#endif
}
#ifdef DEBUG
if (verbose)
{
- printf("\n BB%02u(wt=%s)", curBlk->bbNum, refCntWtd2str(curBlk->getBBWeight(this)));
+ printf("\n " FMT_BB "(wt=%s)", curBlk->bbNum, refCntWtd2str(curBlk->getBBWeight(this)));
}
#endif
}
// Therefore the correct way is to call the Compiler::optPrintLoopInfo(unsigned lnum)
// version of this method.
//
- printf("L%02u, from BB%02u", loopInd, lpFirst->bbNum);
+ printf("L%02u, from " FMT_BB, loopInd, lpFirst->bbNum);
if (lpTop != lpFirst)
{
- printf(" (loop top is BB%02u)", lpTop->bbNum);
+ printf(" (loop top is " FMT_BB ")", lpTop->bbNum);
}
- printf(" to BB%02u (Head=BB%02u, Entry=BB%02u, ExitCnt=%d", lpBottom->bbNum, lpHead->bbNum, lpEntry->bbNum,
- lpExitCnt);
+ printf(" to " FMT_BB " (Head=" FMT_BB ", Entry=" FMT_BB ", ExitCnt=%d", lpBottom->bbNum, lpHead->bbNum,
+ lpEntry->bbNum, lpExitCnt);
if (lpExitCnt == 1)
{
- printf(" at BB%02u", lpExit->bbNum);
+ printf(" at " FMT_BB, lpExit->bbNum);
}
if (parentLoop != BasicBlock::NOT_IN_LOOP)
if (bottom->hasTryIndex() && !comp->bbInTryRegions(bottom->getTryIndex(), first))
{
- JITDUMP("Loop 'first' BB%02u is in an outer EH region compared to loop 'bottom' BB%02u. Rejecting "
+ JITDUMP("Loop 'first' " FMT_BB " is in an outer EH region compared to loop 'bottom' " FMT_BB ". Rejecting "
"loop.\n",
first->bbNum, bottom->bbNum);
return false;
if ((first->bbFlags & BBF_FINALLY_TARGET) != 0)
{
- JITDUMP("Loop 'first' BB%02u is a finally target. Rejecting loop.\n", first->bbNum);
+ JITDUMP("Loop 'first' " FMT_BB " is a finally target. Rejecting loop.\n", first->bbNum);
return false;
}
#endif // FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_)
return false;
}
- JITDUMP("in optCanonicalizeLoop: L%02u has top BB%02u (bottom BB%02u) with natural loop number L%02u: need to "
+ JITDUMP("in optCanonicalizeLoop: L%02u has top " FMT_BB " (bottom " FMT_BB
+ ") with natural loop number L%02u: need to "
"canonicalize\n",
loopInd, t->bbNum, optLoopTable[loopInd].lpBottom->bbNum, t->bbNatLoopNum);
// outside-in, so we shouldn't encounter the new blocks at the loop boundaries, or in the predecessor lists.
if (t->bbNum <= topPredBlock->bbNum && topPredBlock->bbNum <= b->bbNum)
{
- JITDUMP("in optCanonicalizeLoop: 'top' predecessor BB%02u is in the range of L%02u (BB%02u..BB%02u); not "
+ JITDUMP("in optCanonicalizeLoop: 'top' predecessor " FMT_BB " is in the range of L%02u (" FMT_BB ".." FMT_BB
+ "); not "
"redirecting its bottom edge\n",
topPredBlock->bbNum, loopInd, t->bbNum, b->bbNum);
continue;
}
- JITDUMP("in optCanonicalizeLoop: redirect top predecessor BB%02u to BB%02u\n", topPredBlock->bbNum,
+ JITDUMP("in optCanonicalizeLoop: redirect top predecessor " FMT_BB " to " FMT_BB "\n", topPredBlock->bbNum,
newT->bbNum);
optRedirectBlock(topPredBlock, blockMap);
//
if (firstPred)
{
- JITDUMP("in optCanonicalizeLoop: block BB%02u will inheritWeight from BB%02u\n", newT->bbNum,
+ JITDUMP("in optCanonicalizeLoop: block " FMT_BB " will inheritWeight from " FMT_BB "\n", newT->bbNum,
topPredBlock->bbNum);
newT->inheritWeight(topPredBlock);
}
else
{
- JITDUMP("in optCanonicalizeLoop: block BB%02u will also contribute to the weight of BB%02u\n",
+ JITDUMP("in optCanonicalizeLoop: block " FMT_BB " will also contribute to the weight of " FMT_BB "\n",
newT->bbNum, topPredBlock->bbNum);
BasicBlock::weight_t newWeight = newT->getBBWeight(this) + topPredBlock->getBBWeight(this);
newT->bbNatLoopNum = loopInd;
- JITDUMP("in optCanonicalizeLoop: made new block BB%02u [%p] the new unique top of loop %d.\n", newT->bbNum,
+ JITDUMP("in optCanonicalizeLoop: made new block " FMT_BB " [%p] the new unique top of loop %d.\n", newT->bbNum,
dspPtr(newT), loopInd);
// Make sure the head block still goes to the entry...
#ifdef DEBUG
if (verbose)
{
- printf("\nUnrolling loop BB%02u", head->bbNext->bbNum);
+ printf("\nUnrolling loop " FMT_BB, head->bbNext->bbNum);
if (head->bbNext->bbNum != bottom->bbNum)
{
- printf("..BB%02u", bottom->bbNum);
+ printf(".." FMT_BB, bottom->bbNum);
}
printf(" over V%02u from %u to %u", lvar, lbeg, llim);
printf(" unrollCostSz = %d\n", unrollCostSz);
#ifdef DEBUG
if (verbose)
{
- printf("\nDuplicating loop condition in BB%02u for loop (BB%02u - BB%02u)", block->bbNum, block->bbNext->bbNum,
- bTest->bbNum);
+ printf("\nDuplicating loop condition in " FMT_BB " for loop (" FMT_BB " - " FMT_BB ")", block->bbNum,
+ block->bbNext->bbNum, bTest->bbNum);
printf("\nEstimated code size expansion is %d\n ", estDupCostSz);
gtDispTree(copyOfCondStmt);
curCond->inheritWeight(head);
curCond->bbNatLoopNum = head->bbNatLoopNum;
- JITDUMP("Created new block %02d for new level\n", curCond->bbNum);
+ JITDUMP("Created new " FMT_BB " for new level\n", curCond->bbNum);
}
// Finally insert cloning conditions after all deref conditions have been inserted.
{
printf("\nHoisting a copy of ");
printTreeID(origExpr);
- printf(" into PreHeader for loop L%02u <BB%02u..BB%02u>:\n", lnum, optLoopTable[lnum].lpFirst->bbNum,
+ printf(" into PreHeader for loop L%02u <" FMT_BB ".." FMT_BB ">:\n", lnum, optLoopTable[lnum].lpFirst->bbNum,
optLoopTable[lnum].lpBottom->bbNum);
gtDispTree(origExpr);
printf("\n");
#ifdef DEBUG
if (verbose)
{
- printf("This hoisted copy placed in PreHeader (BB%02u):\n", preHead->bbNum);
+ printf("This hoisted copy placed in PreHeader (" FMT_BB "):\n", preHead->bbNum);
gtDispTree(hoist);
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("optHoistLoopCode for loop L%02u <BB%02u..BB%02u>:\n", lnum, begn, endn);
+ printf("optHoistLoopCode for loop L%02u <" FMT_BB ".." FMT_BB ">:\n", lnum, begn, endn);
printf(" Loop body %s a call\n", pLoopDsc->lpContainsCall ? "contains" : "does not contain");
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf(" optHoistLoopExprsForBlock BB%02u (weight=%6s) of loop L%02u <BB%02u..BB%02u>, firstBlock is %s\n",
+ printf(" optHoistLoopExprsForBlock " FMT_BB " (weight=%6s) of loop L%02u <" FMT_BB ".." FMT_BB
+ ">, firstBlock is %s\n",
blk->bbNum, refCntWtd2str(blkWeight), lnum, pLoopDsc->lpFirst->bbNum, pLoopDsc->lpBottom->bbNum,
firstBlockAndBeforeSideEffect ? "true" : "false");
if (blkWeight < (BB_UNITY_WEIGHT / 10))
#ifdef DEBUG
if (verbose)
{
- printf("\nCreated PreHeader (BB%02u) for loop L%02u (BB%02u - BB%02u), with weight = %s\n", preHead->bbNum,
- lnum, top->bbNum, pLoopDsc->lpBottom->bbNum, refCntWtd2str(preHead->getBBWeight(this)));
+ printf("\nCreated PreHeader (" FMT_BB ") for loop L%02u (" FMT_BB " - " FMT_BB "), with weight = %s\n",
+ preHead->bbNum, lnum, top->bbNum, pLoopDsc->lpBottom->bbNum, refCntWtd2str(preHead->getBBWeight(this)));
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("Same PreHeader (BB%02u) can be used for loop L%02u (BB%02u - BB%02u)\n\n", preHead->bbNum,
- l, top->bbNum, optLoopTable[l].lpBottom->bbNum);
+ printf("Same PreHeader (" FMT_BB ") can be used for loop L%02u (" FMT_BB " - " FMT_BB ")\n\n",
+ preHead->bbNum, l, top->bbNum, optLoopTable[l].lpBottom->bbNum);
}
#endif
}
noway_assert((op1->gtOper == GT_LCL_VAR) && (op1->gtLclVarCommon.gtLclNum == ivLclNum));
#endif
- JITDUMP("Checking blocks BB%02d..BB%02d for optimization candidates\n", beg->bbNum,
+ JITDUMP("Checking blocks " FMT_BB ".." FMT_BB " for optimization candidates\n", beg->bbNum,
end->bbNext ? end->bbNext->bbNum : 0);
LoopCloneVisitorInfo info(context, loopNum, nullptr);
#ifdef DEBUG
if (verbose)
{
- printf("Folded %sboolean conditions of BB%02u and BB%02u to :\n", c2->OperIsLeaf() ? "" : "non-leaf ",
- b1->bbNum, b2->bbNum);
+ printf("Folded %sboolean conditions of " FMT_BB " and " FMT_BB " to :\n",
+ c2->OperIsLeaf() ? "" : "non-leaf ", b1->bbNum, b2->bbNum);
gtDispTree(s1);
printf("\n");
}
#ifdef DEBUG
if (m_pCompiler->verbose)
{
- printf("[RangeCheck::Widen] BB%02d, \n", block->bbNum);
+ printf("[RangeCheck::Widen] " FMT_BB ", \n", block->bbNum);
Compiler::printTreeID(tree);
printf("\n");
}
Location* loc2;
if (m_pDefTable->Lookup(hash, &loc2))
{
- JITDUMP("Already have BB%02d, [%06d], [%06d] for hash => %0I64X", loc2->block->bbNum,
+ JITDUMP("Already have " FMT_BB ", [%06d], [%06d] for hash => %0I64X", loc2->block->bbNum,
Compiler::dspTreeID(loc2->stmt), Compiler::dspTreeID(loc2->tree), hash);
assert(false);
}
// arguments. If not a phi argument, check if we assertions about local variables.
void RangeCheck::MergeAssertion(BasicBlock* block, GenTree* op, Range* pRange DEBUGARG(int indent))
{
- JITDUMP("Merging assertions from pred edges of BB%02d for op [%06d] with " FMT_VN "\n", block->bbNum,
+ JITDUMP("Merging assertions from pred edges of " FMT_BB " for op [%06d] " FMT_VN "\n", block->bbNum,
Compiler::dspTreeID(op), op->gtVNPair.GetConservative());
ASSERT_TP assertions = BitVecOps::UninitVal();
if (pred->bbFallsThrough() && pred->bbNext == block)
{
assertions = pred->bbAssertionOut;
- JITDUMP("Merge assertions from pred BB%02d edge: %s\n", pred->bbNum,
+ JITDUMP("Merge assertions from pred " FMT_BB " edge: %s\n", pred->bbNum,
BitVecOps::ToString(m_pCompiler->apTraits, assertions));
}
else if ((pred->bbJumpKind == BBJ_COND || pred->bbJumpKind == BBJ_ALWAYS) && pred->bbJumpDest == block)
if (m_pCompiler->bbJtrueAssertionOut != nullptr)
{
assertions = m_pCompiler->bbJtrueAssertionOut[pred->bbNum];
- JITDUMP("Merge assertions from pred BB%02d JTrue edge: %s\n", pred->bbNum,
+ JITDUMP("Merge assertions from pred " FMT_BB " JTrue edge: %s\n", pred->bbNum,
BitVecOps::ToString(m_pCompiler->apTraits, assertions));
}
}
Range range = GetRange(asgBlock, asg->gtGetOp2(), monotonic DEBUGARG(indent));
if (!BitVecOps::MayBeUninit(block->bbAssertionIn))
{
- JITDUMP("Merge assertions from BB%02d:%s for assignment about [%06d]\n", block->bbNum,
+ JITDUMP("Merge assertions from " FMT_BB ":%s for assignment about [%06d]\n", block->bbNum,
BitVecOps::ToString(m_pCompiler->apTraits, block->bbAssertionIn),
Compiler::dspTreeID(asg->gtGetOp1()));
MergeEdgeAssertions(asg->gtGetOp1()->AsLclVarCommon(), block->bbAssertionIn, &range);
if (m_pCompiler->verbose)
{
Indent(indent);
- JITDUMP("[RangeCheck::GetRange] BB%02d", block->bbNum);
+ JITDUMP("[RangeCheck::GetRange] " FMT_BB, block->bbNum);
m_pCompiler->gtDispTree(expr);
Indent(indent);
JITDUMP("{\n", expr);
// For now, don't report any scopes in funclets. JIT64 doesn't.
siInFuncletRegion = true;
- JITDUMP("Scope info: found beginning of funclet region at block BB%02u; ignoring following blocks\n",
+ JITDUMP("Scope info: found beginning of funclet region at block " FMT_BB "; ignoring following blocks\n",
block->bbNum);
return;
#ifdef DEBUG
if (verbose)
{
- printf("\nScope info: begin block BB%02u, IL range ", block->bbNum);
+ printf("\nScope info: begin block " FMT_BB ", IL range ", block->bbNum);
block->dspBlockILRange();
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("\nScope info: end block BB%02u, IL range ", block->bbNum);
+ printf("\nScope info: end block " FMT_BB ", IL range ", block->bbNum);
block->dspBlockILRange();
printf("\n");
}
#ifdef DEBUG
if (comp->verboseSsa)
{
- printf("[SsaBuilder::TopologicalSort] Pushing BB%02u: [", block->bbNum);
+ printf("[SsaBuilder::TopologicalSort] Pushing " FMT_BB ": [", block->bbNum);
AllSuccessorEnumerator successors(comp, block);
unsigned index = 0;
while (true)
break;
}
- printf("%s%sBB%02u", (index++ ? ", " : ""), (isEHsucc ? "[EH]" : ""), succ->bbNum);
+ printf("%s%s" FMT_BB, (index++ ? ", " : ""), (isEHsucc ? "[EH]" : ""), succ->bbNum);
}
printf("]\n");
}
// all successors have been visited
blocks.Pop();
- DBG_SSA_JITDUMP("[SsaBuilder::TopologicalSort] postOrder[%d] = BB%02u\n", postIndex, block->bbNum);
+ DBG_SSA_JITDUMP("[SsaBuilder::TopologicalSort] postOrder[%d] = " FMT_BB "\n", postIndex, block->bbNum);
postOrder[postIndex] = block;
block->bbPostOrderNum = postIndex;
postIndex += 1;
{
BasicBlock* block = postOrder[i];
- DBG_SSA_JITDUMP("Visiting in reverse post order: BB%02u.\n", block->bbNum);
+ DBG_SSA_JITDUMP("Visiting in reverse post order: " FMT_BB ".\n", block->bbNum);
// Find the first processed predecessor block.
BasicBlock* predBlock = nullptr;
// There could just be a single basic block, so just check if there were any preds.
if (predBlock != nullptr)
{
- DBG_SSA_JITDUMP("Pred block is BB%02u.\n", predBlock->bbNum);
+ DBG_SSA_JITDUMP("Pred block is " FMT_BB ".\n", predBlock->bbNum);
}
// Intersect DOM, if computed, for all predecessors.
changed = true;
// IDom has changed, update it.
- DBG_SSA_JITDUMP("bbIDom of BB%02u becomes BB%02u.\n", block->bbNum, bbIDom ? bbIDom->bbNum : 0);
+ DBG_SSA_JITDUMP("bbIDom of " FMT_BB " becomes " FMT_BB ".\n", block->bbNum, bbIDom ? bbIDom->bbNum : 0);
block->bbIDom = bbIDom;
}
// Mark the current block as visited.
BitVecOps::AddElemD(&m_visitedTraits, m_visited, block->bbNum);
- DBG_SSA_JITDUMP("Marking block BB%02u as processed.\n", block->bbNum);
+ DBG_SSA_JITDUMP("Marking block " FMT_BB " as processed.\n", block->bbNum);
}
}
}
// If the bbIDom map key doesn't exist, create one.
BlkVector* domChildren = domTree->Emplace(bbIDom, domTree->GetAllocator());
- DBG_SSA_JITDUMP("Inserting BB%02u as dom child of BB%02u.\n", block->bbNum, bbIDom->bbNum);
+ DBG_SSA_JITDUMP("Inserting " FMT_BB " as dom child of " FMT_BB ".\n", block->bbNum, bbIDom->bbNum);
// Insert the block into the block's set.
domChildren->push_back(block);
}
printf("After computing dominator tree: \n");
for (BlkToBlkVectorMap::KeyIterator nodes = domTree->Begin(); !nodes.Equal(domTree->End()); ++nodes)
{
- printf("BB%02u := {", nodes.Get()->bbNum);
+ printf(FMT_BB " := {", nodes.Get()->bbNum);
int index = 0;
for (BasicBlock* child : nodes.GetValue())
{
- printf("%sBB%02u", (index++ == 0) ? "" : ",", child->bbNum);
+ printf("%s" FMT_BB, (index++ == 0) ? "" : ",", child->bbNum);
}
printf("}\n");
}
{
BasicBlock* block = postOrder[i];
- DBG_SSA_JITDUMP("Considering block BB%02u.\n", block->bbNum);
+ DBG_SSA_JITDUMP("Considering block " FMT_BB ".\n", block->bbNum);
// Recall that B3 is in the dom frontier of B1 if there exists a B2
// such that B1 dom B2, !(B1 dom B3), and B3 is an immediate successor
for (flowList* pred = blockPreds; pred != nullptr; pred = pred->flNext)
{
- DBG_SSA_JITDUMP(" Considering predecessor BB%02u.\n", pred->flBlock->bbNum);
+ DBG_SSA_JITDUMP(" Considering predecessor " FMT_BB ".\n", pred->flBlock->bbNum);
// If we've found a B2, then consider the possible B1's. We start with
// B2, since a block dominates itself, then traverse upwards in the dominator
for (BasicBlock* b1 = pred->flBlock; (b1 != nullptr) && (b1 != block->bbIDom); // !root && !loop
b1 = b1->bbIDom)
{
- DBG_SSA_JITDUMP(" Adding BB%02u to dom frontier of pred dom BB%02u.\n", block->bbNum, b1->bbNum);
+ DBG_SSA_JITDUMP(" Adding " FMT_BB " to dom frontier of pred dom " FMT_BB ".\n", block->bbNum,
+ b1->bbNum);
BlkVector& b1DF = *mapDF->Emplace(b1, m_allocator);
// It's possible to encounter the same DF multiple times, ensure that we don't add duplicates.
for (int i = 0; i < count; ++i)
{
BasicBlock* b = postOrder[i];
- printf("Block BB%02u := {", b->bbNum);
+ printf("Block " FMT_BB " := {", b->bbNum);
BlkVector* bDF = mapDF->LookupPointer(b);
if (bDF != nullptr)
int index = 0;
for (BasicBlock* f : *bDF)
{
- printf("%sBB%02u", (index++ == 0) ? "" : ",", f->bbNum);
+ printf("%s" FMT_BB, (index++ == 0) ? "" : ",", f->bbNum);
}
}
printf("}\n");
#ifdef DEBUG
if (m_pCompiler->verboseSsa)
{
- printf("IDF(BB%02u) := {", b->bbNum);
+ printf("IDF(" FMT_BB ") := {", b->bbNum);
int index = 0;
for (BasicBlock* f : *bIDF)
{
- printf("%sBB%02u", (index++ == 0) ? "" : ",", f->bbNum);
+ printf("%s" FMT_BB, (index++ == 0) ? "" : ",", f->bbNum);
}
printf("}\n");
}
for (int i = 0; i < count; ++i)
{
BasicBlock* block = postOrder[i];
- DBG_SSA_JITDUMP("Considering dominance frontier of block BB%02u:\n", block->bbNum);
+ DBG_SSA_JITDUMP("Considering dominance frontier of block " FMT_BB ":\n", block->bbNum);
blockIDF.clear();
ComputeIteratedDominanceFrontier(block, &mapDF, &blockIDF);
// For each block "bbInDomFront" that is in the dominance frontier of "block"...
for (BasicBlock* bbInDomFront : blockIDF)
{
- DBG_SSA_JITDUMP(" Considering BB%02u in dom frontier of BB%02u:\n", bbInDomFront->bbNum,
+ DBG_SSA_JITDUMP(" Considering " FMT_BB " in dom frontier of " FMT_BB ":\n", bbInDomFront->bbNum,
block->bbNum);
// Check if variable "lclNum" is live in block "*iterBlk".
{
// We have a variable i that is defined in block j and live at l, and l belongs to dom frontier of
// j. So insert a phi node at l.
- JITDUMP("Inserting phi definition for V%02u at start of BB%02u.\n", lclNum, bbInDomFront->bbNum);
+ JITDUMP("Inserting phi definition for V%02u at start of " FMT_BB ".\n", lclNum,
+ bbInDomFront->bbNum);
GenTree* phiLhs = m_pCompiler->gtNewLclvNode(lclNum, m_pCompiler->lvaTable[lclNum].TypeGet());
// For each block "bbInDomFront" that is in the dominance frontier of "block".
for (BasicBlock* bbInDomFront : blockIDF)
{
- DBG_SSA_JITDUMP(" Considering BB%02u in dom frontier of BB%02u for Memory phis:\n",
+ DBG_SSA_JITDUMP(" Considering " FMT_BB " in dom frontier of " FMT_BB " for Memory phis:\n",
bbInDomFront->bbNum, block->bbNum);
for (MemoryKind memoryKind : allMemoryKinds())
// We have a variable i that is defined in block j and live at l, and l belongs to dom frontier
// of
// j. So insert a phi node at l.
- JITDUMP("Inserting phi definition for %s at start of BB%02u.\n", memoryKindNames[memoryKind],
- bbInDomFront->bbNum);
+ JITDUMP("Inserting phi definition for %s at start of " FMT_BB ".\n",
+ memoryKindNames[memoryKind], bbInDomFront->bbNum);
bbInDomFront->bbMemorySsaPhiFunc[memoryKind] = BasicBlock::EmptyMemoryPhiDef;
}
}
EHblkDsc* tryBlk = m_pCompiler->ehGetBlockExnFlowDsc(block);
if (tryBlk != nullptr)
{
- DBG_SSA_JITDUMP(
- "Definition of local V%02u/d:%d in block BB%02u has exn handler; adding as phi arg to handlers.\n", lclNum,
- count, block->bbNum);
+ DBG_SSA_JITDUMP("Definition of local V%02u/d:%d in block " FMT_BB
+ " has exn handler; adding as phi arg to handlers.\n",
+ lclNum, count, block->bbNum);
while (true)
{
BasicBlock* handler = tryBlk->ExFlowBlock();
#ifdef DEBUG
phiFound = true;
#endif
- DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u to phi defn in handler block BB%02u.\n", count,
- lclNum, handler->bbNum);
+ DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u to phi defn in handler block " FMT_BB ".\n",
+ count, lclNum, handler->bbNum);
break;
}
}
}
// Otherwise...
- DBG_SSA_JITDUMP("Definition of %s/d:%d in block BB%02u has exn handler; adding as phi arg to handlers.\n",
+ DBG_SSA_JITDUMP("Definition of %s/d:%d in block " FMT_BB " has exn handler; adding as phi arg to handlers.\n",
memoryKindNames[memoryKind], count, block->bbNum);
EHblkDsc* tryBlk = m_pCompiler->ehGetBlockExnFlowDsc(block);
while (true)
handlerMemoryPhi = new (m_pCompiler) BasicBlock::MemoryPhiArg(count, handlerMemoryPhi);
}
- DBG_SSA_JITDUMP(" Added phi arg u:%d for %s to phi defn in handler block BB%02u.\n", count,
+ DBG_SSA_JITDUMP(" Added phi arg u:%d for %s to phi defn in handler block " FMT_BB ".\n", count,
memoryKindNames[memoryKind], memoryKind, handler->bbNum);
if ((memoryKind == ByrefExposed) && m_pCompiler->byrefStatesMatchGcHeapStates)
unsigned count = pRenameState->CountForMemoryDef();
pRenameState->PushMemory(memoryKind, block, count);
- DBG_SSA_JITDUMP("Ssa # for %s phi on entry to BB%02u is %d.\n", memoryKindNames[memoryKind],
+ DBG_SSA_JITDUMP("Ssa # for %s phi on entry to " FMT_BB " is %d.\n", memoryKindNames[memoryKind],
block->bbNum, count);
}
}
// Record the "out" Ssa" # for memoryKind.
block->bbMemorySsaNumOut[memoryKind] = pRenameState->CountForMemoryUse(memoryKind);
- DBG_SSA_JITDUMP("Ssa # for %s on entry to BB%02u is %d; on exit is %d.\n", memoryKindNames[memoryKind],
+ DBG_SSA_JITDUMP("Ssa # for %s on entry to " FMT_BB " is %d; on exit is %d.\n", memoryKindNames[memoryKind],
block->bbNum, block->bbMemorySsaNumIn[memoryKind], block->bbMemorySsaNumOut[memoryKind]);
}
}
new (m_pCompiler, GT_PHI_ARG) GenTreePhiArg(tree->gtOp.gtOp1->TypeGet(), lclNum, ssaNum, block);
argList = (phiNode->gtOp.gtOp1 == nullptr ? nullptr : phiNode->gtOp.gtOp1->AsArgList());
phiNode->gtOp.gtOp1 = new (m_pCompiler, GT_LIST) GenTreeArgList(newPhiArg, argList);
- DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u from BB%02u in BB%02u.\n", ssaNum, lclNum, block->bbNum,
- succ->bbNum);
+ DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u from " FMT_BB " in " FMT_BB ".\n", ssaNum, lclNum,
+ block->bbNum, succ->bbNum);
}
m_pCompiler->gtSetStmtInfo(stmt);
succMemoryPhi = new (m_pCompiler) BasicBlock::MemoryPhiArg(ssaNum, succMemoryPhi);
}
}
- DBG_SSA_JITDUMP(" Added phi arg for %s u:%d from BB%02u in BB%02u.\n", memoryKindNames[memoryKind],
- block->bbMemorySsaNumOut[memoryKind], block->bbNum, succ->bbNum);
+ DBG_SSA_JITDUMP(" Added phi arg for %s u:%d from " FMT_BB " in " FMT_BB ".\n",
+ memoryKindNames[memoryKind], block->bbMemorySsaNumOut[memoryKind], block->bbNum,
+ succ->bbNum);
}
}
new (m_pCompiler, GT_PHI_ARG) GenTreePhiArg(lclVar->TypeGet(), lclNum, ssaNum, block);
phiNode->gtOp.gtOp1 = new (m_pCompiler, GT_LIST) GenTreeArgList(newPhiArg, argList);
- DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u from BB%02u in BB%02u.\n", ssaNum, lclNum,
- block->bbNum, handlerStart->bbNum);
+ DBG_SSA_JITDUMP(" Added phi arg u:%d for V%02u from " FMT_BB " in " FMT_BB ".\n", ssaNum,
+ lclNum, block->bbNum, handlerStart->bbNum);
m_pCompiler->gtSetStmtInfo(stmt);
m_pCompiler->fgSetStmtSeq(stmt);
handlerMemoryPhi = new (m_pCompiler)
BasicBlock::MemoryPhiArg(block->bbMemorySsaNumOut[memoryKind], handlerMemoryPhi);
}
- DBG_SSA_JITDUMP(" Added phi arg for %s u:%d from BB%02u in BB%02u.\n",
+ DBG_SSA_JITDUMP(" Added phi arg for %s u:%d from " FMT_BB " in " FMT_BB ".\n",
memoryKindNames[memoryKind], block->bbMemorySsaNumOut[memoryKind], block->bbNum,
handlerStart->bbNum);
}
blocksToDo->pop_back();
BasicBlock* block = blockWrk.m_blk;
- DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables](BB%02u, processed = %d)\n", block->bbNum, blockWrk.m_processed);
+ DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables](" FMT_BB ", processed = %d)\n", block->bbNum,
+ blockWrk.m_processed);
if (!blockWrk.m_processed)
{
{
for (BasicBlock* child : *domChildren)
{
- DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables](pushing dom child BB%02u)\n", child->bbNum);
+ DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables](pushing dom child " FMT_BB ")\n", child->bbNum);
blocksToDo->push_back(BlockWork(child));
}
}
{
// Done, pop all the stack count, if there is one for this block.
BlockPopStacks(block, pRenameState);
- DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables] done with BB%02u\n", block->bbNum);
+ DBG_SSA_JITDUMP("[SsaBuilder::RenameVariables] done with " FMT_BB "\n", block->bbNum);
}
}
{
for (int i = count - 1; i >= 0; --i)
{
- printf("After SSA BB%02u:\n", postOrder[i]->bbNum);
+ printf("After SSA " FMT_BB ":\n", postOrder[i]->bbNum);
m_pCompiler->gtDispTreeList(postOrder[i]->bbTreeList);
}
}
EnsureStacks();
// We'll use BB00 here to indicate the "block before any real blocks..."
- DBG_SSA_JITDUMP("[SsaRenameState::Push] BB%02u, V%02u, count = %d\n", bb != nullptr ? bb->bbNum : 0, lclNum, count);
+ DBG_SSA_JITDUMP("[SsaRenameState::Push] " FMT_BB ", V%02u, count = %d\n", bb != nullptr ? bb->bbNum : 0, lclNum,
+ count);
Stack* stack = stacks[lclNum];
printf("\tContents of the stack: [");
for (Stack::iterator iter2 = stack->begin(); iter2 != stack->end(); iter2++)
{
- printf("<BB%02u, %d>", ((*iter2).m_bb != nullptr ? (*iter2).m_bb->bbNum : 0), (*iter2).m_count);
+ printf("<" FMT_BB ", %d>", ((*iter2).m_bb != nullptr ? (*iter2).m_bb->bbNum : 0), (*iter2).m_count);
}
printf("]\n");
void SsaRenameState::PopBlockStacks(BasicBlock* block)
{
- DBG_SSA_JITDUMP("[SsaRenameState::PopBlockStacks] BB%02u\n", block->bbNum);
+ DBG_SSA_JITDUMP("[SsaRenameState::PopBlockStacks] " FMT_BB "\n", block->bbNum);
// Iterate over the stacks for all the variables, popping those that have an entry
// for "block" on top.
while (!definedLocs.empty() && definedLocs.back().m_bb == block)
{
printf(", ");
}
- printf("<BB%02u, %2d>", ((*iter2).m_bb != nullptr ? (*iter2).m_bb->bbNum : 0), (*iter2).m_count);
+ printf("<" FMT_BB ", %2d>", ((*iter2).m_bb != nullptr ? (*iter2).m_bb->bbNum : 0),
+ (*iter2).m_count);
}
}
printf("\n");
add->acdStkLvlInit = true;
if (add->acdStkLvl != currentStackLevel)
{
- JITDUMP("Wrong stack level was set for block %d\n", add->acdDstBlk->bbNum);
+ JITDUMP("Wrong stack level was set for " FMT_BB "\n", add->acdDstBlk->bbNum);
}
#ifdef DEBUG
add->acdDstBlk->bbTgtStkDepth = currentStackLevel;
void FinishVisit(BasicBlock* blk)
{
#ifdef DEBUG_VN_VISIT
- JITDUMP("finish(BB%02u).\n", blk->bbNum);
+ JITDUMP("finish(" FMT_BB ").\n", blk->bbNum);
#endif // DEBUG_VN_VISIT
SetVisitBit(blk->bbNum, BVB_complete);
for (BasicBlock* succ : blk->GetAllSuccs(m_comp))
{
#ifdef DEBUG_VN_VISIT
- JITDUMP(" Succ(BB%02u).\n", succ->bbNum);
+ JITDUMP(" Succ(" FMT_BB ").\n", succ->bbNum);
#endif // DEBUG_VN_VISIT
if (GetVisitBit(succ->bbNum, BVB_complete))
#ifdef DEBUG
if (verbose)
{
- printf("The SSA definition for %s (#%d) at start of BB%02u is ", memoryKindNames[memoryKind],
+ printf("The SSA definition for %s (#%d) at start of " FMT_BB " is ", memoryKindNames[memoryKind],
blk->bbMemorySsaNumIn[memoryKind], blk->bbNum);
vnPrint(fgCurMemoryVN[memoryKind], 1);
printf("\n");
compCurStmtNum++;
if (verbose)
{
- printf("\n***** BB%02u, stmt %d (before)\n", blk->bbNum, compCurStmtNum);
+ printf("\n***** " FMT_BB ", stmt %d (before)\n", blk->bbNum, compCurStmtNum);
gtDispTree(stmt->gtStmt.gtStmtExpr);
printf("\n");
}
#ifdef DEBUG
if (verbose)
{
- printf("\n***** BB%02u, stmt %d (after)\n", blk->bbNum, compCurStmtNum);
+ printf("\n***** " FMT_BB ", stmt %d (after)\n", blk->bbNum, compCurStmtNum);
gtDispTree(stmt->gtStmt.gtStmtExpr);
printf("\n");
if (stmt->gtNext)
#ifdef DEBUG
if (verbose)
{
- printf("Computing %s state for block BB%02u, entry block for loops %d to %d:\n", memoryKindNames[memoryKind],
- entryBlock->bbNum, innermostLoopNum, loopNum);
+ printf("Computing %s state for block " FMT_BB ", entry block for loops %d to %d:\n",
+ memoryKindNames[memoryKind], entryBlock->bbNum, innermostLoopNum, loopNum);
}
#endif // DEBUG
#ifdef DEBUG
if (verbose)
{
- printf(" Entry block has >1 non-loop preds: (at least) BB%02u and BB%02u.\n", nonLoopPred->bbNum,
- predBlock->bbNum);
+ printf(" Entry block has >1 non-loop preds: (at least) " FMT_BB " and " FMT_BB ".\n",
+ nonLoopPred->bbNum, predBlock->bbNum);
}
#endif // DEBUG
multipleNonLoopPreds = true;