-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
remove Expr typ
field
#27499
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
remove Expr typ
field
#27499
Conversation
# convert an inferred static parameter value to the inferred type of a static_parameter expression | ||
function sparam_type(@nospecialize(val)) | ||
if isa(val, TypeVar) | ||
if Any <: val.ub |
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.
val.ub
may be a TypeVar
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.
This PR only moved this code. But also I think vars in bounds are normalized away in inferencestate.jl.
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.
Ah, OK – that makes sense. I was wondering what all of those loops were doing there.
base/compiler/ssair/inlining2.jl
Outdated
@@ -644,9 +645,9 @@ function analyze_method!(idx, f, ft, metharg, methsp, method, stmt, atypes, sv, | |||
|
|||
@timeit "inline IR inflation" if src.codelocs === nothing | |||
# TODO: another way to detect IR that uses slots? | |||
ir2 = just_construct_ssa(src, ast, na-1) | |||
ir2 = just_construct_ssa(src, ast, na-1), spvals_from_meth_instance(linfo) |
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.
clearly deadcode (old IR)
base/compiler/ssair/show.jl
Outdated
end | ||
#if print_typ && stmt.typ !== Any | ||
# Base.print(io, "::$(stmt.typ)") | ||
#end |
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.
delete?
base/compiler/ssair/show.jl
Outdated
end | ||
#if print_typ && stmt.typ !== Any | ||
# Base.print(io, "::$(stmt.typ)") | ||
#end |
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.
delete?
if x.head === :static_parameter | ||
return sparam_type(spvals[x.args[1]]) | ||
elseif x.head === :boundscheck | ||
return Bool |
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 are these cases necessary? It seems like it would be very bad if ci.ssavaluetypes[idx]
didn't also have the right answer
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.
These can occur as arguments to calls.
base/show.jl
Outdated
show_type = false | ||
end | ||
#end |
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.
fixme?
test/compiler/compiler.jl
Outdated
end | ||
test_inferred_static(code) | ||
#test_inferred_static(codetype) |
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.
fixme?
11d2817
to
4b26ae2
Compare
4b26ae2
to
48ce759
Compare
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.
@nanosoldier runbenchmarks(ALL, vs = ":master")
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
Also, hooray, Nanosoldier lives again. |
Looks good, except for maybe |
@nanosoldier |
Your benchmark job has completed - no performance regressions were detected. A full report can be found here. cc @ararslan |
Alright. In that case - let’s merge! |
A long time coming! (see #24027)
We now keep type information in a separate array in the IR, so this field is redundant. Also Exprs are mostly used for surface ASTs where the
typ
field is not used at all, so it doesn't really make sense to have it.