Skip to content

partialexecuter: increment and check basicblock visit count after terminals #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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