-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor inlining to allow re-use in more sophisticated inlining pass…
…es (#37027) The inlining transform basically has three parts: 1. Analysis (What needs to be inlined and are we allowed to do that?) 2. Policy (Should we inline this?) 3. Mechanism (Stuff the bits from one function into the other) At the moment, we already separate this out into two passes: Analysis/Policy (assemble_inline_todo!) and Mechanism (batch_inline!). For our needs in base, the policy bits are quite simple (how large is the optimized version of this function), but that policy is insufficient for some more sophisticated inlining needs I have in an external compiler pass (where I want to interleave inlining with different transforms as well as potentially run inlining multiple times). To facilitate such use cases, this commit optionally splits out the policy part, but lets the analysis and mechanism parts be re-used by a more sophisticated inlining pass. It also refactors the optimization state to more clearly delineate the different independent parts (edge tracking, inference catches, method table), as well as making the different parts optional (where not required). We were already essentially supporting optimization without edge tracking (for testing purposes), so this is just a bit more explicit about it (which is useful for me, since the different inlining passes in my pipeline may need different settings). For base itself, nothing should functionally change, though hopefully things are factored a bit cleaner.
- Loading branch information
Showing
7 changed files
with
283 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.