-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
simplify inline cost computation, update docs #42997
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
Conversation
base/compiler/optimize.jl
Outdated
sig == Tuple{sig.parameters[1],Any,Any,Any,Vararg{Any}}) | ||
inlineable = true | ||
sig === Tuple{sig.parameters[1],Any,Any,Any,Vararg{Any}}) | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we using
diff --git a/base/operators.jl b/base/operators.jl
index 82b393e0a9..dcc0c3704a 100644
--- a/base/operators.jl
+++ b/base/operators.jl
@@ -636,7 +636,7 @@ for op in (:+, :*, :&, :|, :xor, :min, :max, :kron)
# note: these definitions must not cause a dispatch loop when +(a,b) is
# not defined, and must only try to call 2-argument definitions, so
# that defining +(a,b) is sufficient for full functionality.
- ($op)(a, b, c, xs...) = afoldl($op, ($op)(($op)(a,b),c), xs...)
+ @inline ($op)(a, b, c, xs...) = afoldl($op, ($op)(($op)(a,b),c), xs...)
# a further concern is that it's easy for a type like (Int,Int...)
# to match many definitions, so we need to keep the number of
# definitions down to avoid losing type information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only difference seems to be that the definition-site annotation is only respected when the call signature is concrete ?
julia/base/compiler/optimize.jl
Lines 296 to 297 in d6f59fa
if src.inlineable && isdispatchtuple(specTypes) | |
# obey @inline declaration if a dispatch barrier would not help |
Well, I don't think it makes much difference in reality (we can't get best performance when there is type instability anyway), and so I'm inclined to simply switch to the annotation.
@nanosoldier |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
bb3b743
to
77ad3b0
Compare
@nanosoldier |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Removes a special inline treatment that seems probably antiquated.
Removes a special inline treatment that seems probably antiquated.
No description provided.