-
-
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
[NewOptimizer] Port #26826 to new optimizer #26981
Conversation
base/compiler/ssair/inlining2.jl
Outdated
if isa(def, SSAValue) && is_tuple_call(ir, ir[def]) | ||
for tuparg in ir[def].args[2:end] | ||
push!(new_atypes, exprtype(tuparg, ir, ir.mod)) | ||
end | ||
elseif (isa(def, Argument) && def === stmt.args[end] && !isempty(sv.result_vargs)) |
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.
@Keno I don't think we need a new field in IRCode
for this, since !isempty(sv.result_vargs))
will only be true
if it's a varargs method AND it has cached varargs type info (IIUC).
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.
Oh, I forgot to check def.n
. Let me do that...
base/compiler/ssair/inlining2.jl
Outdated
@@ -577,15 +577,17 @@ function analyze_method!(idx, f, ft, metharg, methsp, method, stmt, atypes, sv, | |||
end | |||
|
|||
# Handle vararg functions | |||
prevararg_rewritten_atypes = atypes |
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.
If this is what's used for the cache, is the below atypes actually used anywhere?
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.
Oh neat, you're right - the modified atypes
was used elsewhere in the old inlining code, but not here. I guess I can just remove that code then.
Ah, good point. |
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.
LGTM if tests pass with this and the new optimizer enabled.
@@ -576,15 +576,6 @@ function analyze_method!(idx, f, ft, metharg, methsp, method, stmt, atypes, sv, | |||
return ConstantCase(quoted(linfo.inferred_const), method, Any[methsp...], metharg) | |||
end | |||
|
|||
# Handle vararg functions | |||
isva = na > 0 && method.isva |
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.
isva
is used below still.
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.
A bunch of thing seems to go of the rails when I run the tests with this PR.
Just started a local build + tests with the new optimizer enabled, anything I should watch out for? Do all tests on master pass with the new optimizer enabled (besides the ones from #26826, which should require this port)? |
Yes, tests pass on master. |
Okay, I ran tests locally, and it seems there's only one thing that's failing:
This is the broken sparse arrays broadcast test that #26826 allowed us to mark as unbroken. I guess it's still broken with the new optimizer. We could investigate why, and in the meantime just mark it |
Is that with this PR merged? That's what I saw before I merged this PR. |
That's from running
I could run it on the merge commit as well, did that change things (i.e. have changes to master since 429a885 broken other tests w.r.t. the new optimizer when combined with this PR)? A summary for anybody following along (cc @vchuravy, since you asked about the relevant test in #26989): #26826 added some compiler tests that should've failed under the new optimizer before this PR, and this PR allows those tests to pass w/ the new optimizer enabled. Furthermore, #26826 fixed the aforementioned |
Seems like I may have had other thing locally mess up my test results. Merging. |
No description provided.