-
-
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.
Make an inference hot-path slightly faster (#44421)
This aims to improve performance of inference slightly by removing a dynamic dispatch from calls to `widenwrappedconditional`, which appears in various hot paths and showed up in profiling of inference. There's two changes here: 1. Improve inlining for calls to functions of the form ``` f(x::Int) = 1 f(@nospecialize(x::Any)) = 2 ``` Previously, we would peel of the `x::Int` case and then generate a dynamic dispatch for the `x::Any` case. After this change, we directly emit an `:invoke` for the `x::Any` case (as well as enabling inlining of it in general). 2. Refactor `widenwrappedconditional` itself to avoid a signature with a union in it, since ironically union splitting cannot currently deal with that (it can only split unions if they're manifest in the call arguments).
- Loading branch information
Showing
4 changed files
with
72 additions
and
30 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
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