Skip to content

Commit

Permalink
partialexecuter: increment and check basicblock visit count after ter…
Browse files Browse the repository at this point in the history
…minals
  • Loading branch information
Hyxogen authored and alexp-sssup committed Feb 8, 2024
1 parent ce7efcc commit 0efaba0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions llvm/lib/CheerpWriter/PartialExecuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1699,8 +1699,10 @@ void PartialInterpreter::visitOuter(FunctionData& data, llvm::Instruction& I)
{
BasicBlock* next = findNextBasicBlock(I);

if (next)
if (next && data.getVisitCounter(next) < MAX_NUMBER_OF_VISITS_PER_BB)
{
data.incrementVisitCounter(next);

// We know where execution should proceed
incomingBB = I.getParent();
getTopCallFrame().CurBB = next;
Expand All @@ -1709,10 +1711,7 @@ void PartialInterpreter::visitOuter(FunctionData& data, llvm::Instruction& I)
// Also here we have set the proper state for the execution so we can return
return;
}
else
{
skip = true;
}
skip = true;
}

if (addToCounter(I.getFunction()))
Expand Down

0 comments on commit 0efaba0

Please sign in to comment.