typedef unsigned char loopNumber;
static const unsigned NOT_IN_LOOP = UCHAR_MAX;
- // This is the label a loop gets as part of the second, reachability-based
- // loop discovery mechanism. This is apparently only used for debugging.
- // We hope we'll eventually just have one loop-discovery mechanism, and this will go away.
- INDEBUG(loopNumber bbLoopNum;) // set to 'n' for a loop #n header
-
loopNumber bbNatLoopNum; // Index, in optLoopTable, of most-nested loop that contains this block,
// or else NOT_IN_LOOP if this block is not in a loop.
noway_assert(begBlk->bbNum <= endBlk->bbNum);
noway_assert(begBlk->isLoopHead());
noway_assert(fgReachable(begBlk, endBlk));
+ noway_assert(!opts.MinOpts());
#ifdef DEBUG
if (verbose)
{
- printf("\nMarking loop L%02u", begBlk->bbLoopNum);
+ printf("\nMarking a loop from " FMT_BB " to " FMT_BB, begBlk->bbNum,
+ excludeEndBlk ? endBlk->bbPrev->bbNum : endBlk->bbNum);
}
#endif
- noway_assert(!opts.MinOpts());
-
/* Build list of backedges for block begBlk */
flowList* backedgeList = nullptr;
{
if (backEdgeCount > 0)
{
- printf("\nNot removing loop L%02u, due to an additional back edge", begBlk->bbLoopNum);
+ printf("\nNot removing loop at " FMT_BB ", due to an additional back edge", begBlk->bbNum);
}
else if (backEdgeCount == 0)
{
- printf("\nNot removing loop L%02u, due to no back edge", begBlk->bbLoopNum);
+ printf("\nNot removing loop at " FMT_BB ", due to no back edge", begBlk->bbNum);
}
}
#endif
#ifdef DEBUG
if (verbose)
{
- printf("\nUnmarking loop L%02u", begBlk->bbLoopNum);
+ printf("\nUnmarking loop at " FMT_BB, begBlk->bbNum);
}
#endif
{
noway_assert(lpHead);
- //
- // NOTE: we take "loopInd" as an argument instead of using the one
- // stored in begBlk->bbLoopNum because sometimes begBlk->bbLoopNum
- // has not be set correctly. For example, in optRecordLoop().
- // However, in most of the cases, loops should have been recorded.
- // Therefore the correct way is to call the Compiler::optPrintLoopInfo(unsigned lnum)
- // version of this method.
- //
printf("L%02u, from " FMT_BB, loopInd, lpFirst->bbNum);
if (lpTop != lpFirst)
{
continue;
}
- assert(block->bbLoopNum == 0);
-
if (compCodeOpt() != SMALL_CODE)
{
/* Optimize "while(cond){}" loops to "cond; do{}while(cond);" */
if (foundBottom)
{
loopNum++;
-#ifdef DEBUG
- /* Mark the loop header as such */
- assert(FitsIn<unsigned char>(loopNum));
- top->bbLoopNum = (unsigned char)loopNum;
-#endif
/* Mark all blocks between 'top' and 'bottom' */