-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
optimizer: supports callsite annotations of inlining, fixes #18773 #41328
Merged
Commits on Aug 31, 2021
-
optimizer: supports callsite annotations of inlining, fixes #18773
Enable `@inline`/`@noinline` annotations on function callsites. From #40754. Now `@inline` and `@noinline` can be applied to a code block and then the compiler will try to (not) inline calls within the block: ```julia @inline f(...) # The compiler will try to inline `f` @inline f(...) + g(...) # The compiler will try to inline `f`, `g` and `+` @inline f(args...) = ... # Of course annotations on a definition is still allowed ``` Here are couple of notes on how those callsite annotations will work: - callsite annotation always has the precedence over the annotation applied to the definition of the called function, whichever we use `@inline`/`@noinline`: ```julia @inline function explicit_inline(args...) # body end let @noinline explicit_inline(args...) # this call will not be inlined end ``` - when callsite annotations are nested, the innermost annotations has the precedence ```julia @noinline let a0, b0 = ... a = @inline f(a0) # the compiler will try to inline this call b = notinlined(b0) # the compiler will NOT try to inline this call return a, b end ``` They're both tested and included in documentations.
Configuration menu - View commit details
-
Copy full SHA for 9c35a04 - Browse repository at this point
Copy the full SHA 9c35a04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c7482f - Browse repository at this point
Copy the full SHA 1c7482fView commit details -
Configuration menu - View commit details
-
Copy full SHA for addd655 - Browse repository at this point
Copy the full SHA addd655View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e1378f - Browse repository at this point
Copy the full SHA 1e1378fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 99cbff6 - Browse repository at this point
Copy the full SHA 99cbff6View commit details -
Update base/compiler/ssair/inlining.jl
Co-authored-by: Jameson Nash <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 382a80c - Browse repository at this point
Copy the full SHA 382a80cView commit details -
Co-authored-by: Jameson Nash <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4ecf149 - Browse repository at this point
Copy the full SHA 4ecf149View commit details -
- remove preprocessed flags from `jl_code_info_set_ir` - fix duplicated definition warning - add and fix comments
Configuration menu - View commit details
-
Copy full SHA for 490dda0 - Browse repository at this point
Copy the full SHA 490dda0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 783d32d - Browse repository at this point
Copy the full SHA 783d32dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 322291b - Browse repository at this point
Copy the full SHA 322291bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3805d86 - Browse repository at this point
Copy the full SHA 3805d86View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.