Skip to content

Commit 5712202

Browse files
authored
JIT: allow inliner to use up more of the lva "budget" (#118515)
We currently stop inlining once we hit a fixed limit of 512 local vars (specified via `MAX_LV_NUM_COUNT_FOR_INLINING`). We hit this limit now more often because of increased inliner aggressiveness, and at any rate it should be some fraction of `JitMaxLocalsToTrack` instead of a fixed value. When the inliner hits this limit it often leaves quite valuable inlines on the table. Revise this so the inliner is allowed to consume 90% of the max locals during inlining (50% would be a no-diff change). This fixes some regressions reported in #114996 which were then made worse by #116054.
1 parent d46599d commit 5712202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/jit/fginline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result,
11001100
}
11011101
#endif // defined(DEBUG)
11021102

1103-
if (lvaCount >= MAX_LV_NUM_COUNT_FOR_INLINING)
1103+
if (lvaHaveManyLocals(0.9f))
11041104
{
11051105
// For now, attributing this to call site, though it's really
11061106
// more of a budget issue (lvaCount currently includes all

0 commit comments

Comments
 (0)