Skip to content

Commit

Permalink
Check if bbNatLoopNum is not NOT_IN_LOOP (#92132)
Browse files Browse the repository at this point in the history
* Check if bbNatLoopNum is not NOT_IN_LOOP

* review feedback
  • Loading branch information
kunalspathak authored Sep 16, 2023
1 parent 9f4c5f7 commit fd20f42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5254,8 +5254,8 @@ PhaseStatus Compiler::placeLoopAlignInstructions()
memset(visitedLoopNum, false, sizeof(visitedLoopNum));

#ifdef DEBUG
int visitedBlockForLoopNum[BasicBlock::MAX_LOOP_NUM];
memset(visitedBlockForLoopNum, false, sizeof(visitedBlockForLoopNum));
unsigned visitedBlockForLoopNum[BasicBlock::MAX_LOOP_NUM];
memset(visitedBlockForLoopNum, 0, sizeof(visitedBlockForLoopNum));
#endif

if ((fgFirstBB != nullptr) && fgFirstBB->isLoopAlign())
Expand Down Expand Up @@ -5333,11 +5333,11 @@ PhaseStatus Compiler::placeLoopAlignInstructions()
madeChanges = true;
unmarkedLoopAlign = true;
}
else if (visitedLoopNum[loopTop->bbNatLoopNum])
else if ((loopTop->bbNatLoopNum != BasicBlock::NOT_IN_LOOP) && visitedLoopNum[loopTop->bbNatLoopNum])
{
#ifdef DEBUG
char buffer[50];
sprintf_s(buffer, 50, "loop block " FMT_BB " appears before top of loop",
char buffer[100];
sprintf_s(buffer, 100, "loop block " FMT_BB " appears before top of loop",
visitedBlockForLoopNum[loopTop->bbNatLoopNum]);
#endif

Expand Down

0 comments on commit fd20f42

Please sign in to comment.