if (edge->flEdgeWeightMin < BB_MAX_WEIGHT)
{
- printf("(%s", refCntWtd2str(edge->flEdgeWeightMin));
+ printf("(%u", edge->flEdgeWeightMin);
}
else
{
{
if (edge->flEdgeWeightMax < BB_MAX_WEIGHT)
{
- printf("..%s", refCntWtd2str(edge->flEdgeWeightMax));
+ printf("..%u", edge->flEdgeWeightMax);
}
else
{
}
else
{
- printf("%6s", refCntWtd2str(block->getBBWeight(this)));
+ BasicBlock::weight_t weight = block->getBBWeight(this);
+
+ if (weight > 99999) // Is it going to be more than 6 characters?
+ {
+ if (weight <= 99999 * BB_UNITY_WEIGHT)
+ {
+ // print weight in this format ddddd.
+ printf("%5u.", (weight + (BB_UNITY_WEIGHT / 2)) / BB_UNITY_WEIGHT);
+ }
+ else // print weight in terms of k (i.e. 156k )
+ {
+ // print weight in this format dddddk
+ BasicBlock::weight_t weightK = weight / 1000;
+ printf("%5uk", (weightK + (BB_UNITY_WEIGHT / 2)) / BB_UNITY_WEIGHT);
+ }
+ }
+ else // print weight in this format ddd.dd
+ {
+ printf("%6s", refCntWtd2str(weight));
+ }
}
+ printf(" ");
//
// Display optional IBC weight column.
// clang-format off
printf("\n");
- printf("------%*s------------------------------------%*s-----------------------%*s----------------------------------------\n",
+ printf("------%*s-------------------------------------%*s-----------------------%*s----------------------------------------\n",
padWidth, "------------",
ibcColWidth, "------------",
maxBlockNumWidth, "----");
- printf("BBnum %*sdescAddr ref try hnd %s weight %*s%s [IL range] [jump]%*s [EH region] [flags]\n",
+ printf("BBnum %*sdescAddr ref try hnd %s weight %*s%s [IL range] [jump]%*s [EH region] [flags]\n",
padWidth, "",
fgCheapPredsValid ? "cheap preds" :
(fgComputePredsDone ? "preds "
: ""),
maxBlockNumWidth, ""
);
- printf("------%*s------------------------------------%*s-----------------------%*s----------------------------------------\n",
+ printf("------%*s-------------------------------------%*s-----------------------%*s----------------------------------------\n",
padWidth, "------------",
ibcColWidth, "------------",
maxBlockNumWidth, "----");
if (block == fgFirstColdBlock)
{
- printf("~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~~~"
- "~~~~~~~~~~~~~~~\n",
+ printf("~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~%*s~~~~~~~~~~~~~~~~~~~~~~~~"
+ "~~~~~~~~~~~~~~~~\n",
padWidth, "~~~~~~~~~~~~", ibcColWidth, "~~~~~~~~~~~~", maxBlockNumWidth, "~~~~");
}
#if FEATURE_EH_FUNCLETS
if (block == fgFirstFuncletBB)
{
- printf("++++++%*s++++++++++++++++++++++++++++++++++++%*s+++++++++++++++++++++++%*s+++++++++++++++++++++++++"
- "+++++++++++++++ funclets follow\n",
+ printf("++++++%*s+++++++++++++++++++++++++++++++++++++%*s+++++++++++++++++++++++%*s++++++++++++++++++++++++"
+ "++++++++++++++++ funclets follow\n",
padWidth, "++++++++++++", ibcColWidth, "++++++++++++", maxBlockNumWidth, "++++");
}
#endif // FEATURE_EH_FUNCLETS
}
}
- printf("------%*s------------------------------------%*s-----------------------%*s---------------------------------"
- "-------\n",
+ printf("------%*s-------------------------------------%*s-----------------------%*s--------------------------------"
+ "--------\n",
padWidth, "------------", ibcColWidth, "------------", maxBlockNumWidth, "----");
if (dumpTrees)
nump = (nump == num1) ? num2 : num1;
- unsigned valueInt = refCntWtd / BB_UNITY_WEIGHT;
- unsigned valueFrac = refCntWtd % BB_UNITY_WEIGHT;
-
- if (valueFrac == 0)
+ if (refCntWtd == BB_MAX_WEIGHT)
{
- sprintf_s(temp, bufSize, "%2u ", valueInt);
+ sprintf_s(temp, bufSize, "MAX ");
}
else
{
- sprintf_s(temp, bufSize, "%2u.%1u", valueInt, (valueFrac * 10 / BB_UNITY_WEIGHT));
- }
+ unsigned valueInt = refCntWtd / BB_UNITY_WEIGHT;
+ unsigned valueFrac = refCntWtd % BB_UNITY_WEIGHT;
+ if (valueFrac == 0)
+ {
+ sprintf_s(temp, bufSize, "%u ", valueInt);
+ }
+ else
+ {
+ sprintf_s(temp, bufSize, "%u.%02u", valueInt, (valueFrac * 100 / BB_UNITY_WEIGHT));
+ }
+ }
return temp;
}