Skip to content

Commit

Permalink
Add a Statistic for speculative inlinings.
Browse files Browse the repository at this point in the history
Summary:
It would be good to have a compiler statistic to tell how many inlinings are speculative.

This diff adds that.

Reviewed By: avp

Differential Revision: D70132784

fbshipit-source-id: 2dceec02cd694aa1fe962dd8505f48cbe7194529
  • Loading branch information
David Detlefs authored and facebook-github-bot committed Feb 25, 2025
1 parent e5c29ad commit 09dee68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Optimizer/Scalar/Inlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "llvh/Support/Debug.h"

STATISTIC(NumInlinedCalls, "Number of inlined calls");
STATISTIC(
NumSpecInlinedCalls,
"Number of inlined calls that are speculatively inlined");

namespace hermes {

Expand Down Expand Up @@ -635,6 +638,8 @@ bool Inlining::runOnModule(Module *M) {

// Continue inserting in inlineBB.
builder.setInsertionBlock(inlineBB);

++NumSpecInlinedCalls;
}

auto *returnValue = inlineFunction(builder, FC, CI, nextBlock);
Expand Down

0 comments on commit 09dee68

Please sign in to comment.