-
Notifications
You must be signed in to change notification settings - Fork 38
apply_type_with_promotion #1681
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
b4e1455
12b1d63
138b9db
c9b4f12
0faa1dc
f6e3226
e2141ef
32f75f5
d213c55
fca90a0
29a3534
5866b84
65f9d24
7edef34
77eb5a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -622,6 +622,28 @@ Base.@nospecializeinfer function traced_type_inner( | |||||||||||||||||||
| return PT | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| function collect_tvars_in_type!(dependencies, @nospecialize(t)) | ||||||||||||||||||||
| if t isa TypeVar | ||||||||||||||||||||
| push!(dependencies, t) | ||||||||||||||||||||
| return | ||||||||||||||||||||
| end | ||||||||||||||||||||
| if t isa DataType | ||||||||||||||||||||
| for p in t.parameters | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, p) | ||||||||||||||||||||
| end | ||||||||||||||||||||
| elseif t isa Union | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.a) | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.b) | ||||||||||||||||||||
| elseif t isa UnionAll | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.var.lb) | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.var.ub) | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.body) | ||||||||||||||||||||
| elseif t isa Core.TypeofVararg | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.T) | ||||||||||||||||||||
| collect_tvars_in_type!(dependencies, t.N) | ||||||||||||||||||||
| end | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Base.@nospecializeinfer function traced_type_inner( | ||||||||||||||||||||
| @nospecialize(T::Type), | ||||||||||||||||||||
| seen, | ||||||||||||||||||||
|
|
@@ -710,11 +732,16 @@ Base.@nospecializeinfer function traced_type_inner( | |||||||||||||||||||
| return T | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| @debug "traced_type_inner: Processing type with field changes" T=T subTys=subTys | ||||||||||||||||||||
|
||||||||||||||||||||
| @debug "traced_type_inner: Processing type with field changes" T=T subTys=subTys | |
| @debug "traced_type_inner: Processing type with field changes" T = T subTys = subTys |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "wrapped flags" wrapped_cpjrt_array=wrapped_cpjrt_array wrapped_cifrt_array=wrapped_cifrt_array wrapped_tracedarray=wrapped_tracedarray | |
| @debug "wrapped flags" wrapped_cpjrt_array = wrapped_cpjrt_array wrapped_cifrt_array = | |
| wrapped_cifrt_array wrapped_tracedarray = wrapped_tracedarray |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Tracing type parameters" num_params=length(T.parameters) T_parameters=T.parameters | |
| @debug "Tracing type parameters" num_params = length(T.parameters) T_parameters = | |
| T.parameters |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Built subParms" subParms=subParms | |
| @debug "Built subParms" subParms = subParms |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Calling apply_type_with_promotion" wrapper=T.name.wrapper subParms=subParms num_params=length(T.parameters) | |
| @debug "Calling apply_type_with_promotion" wrapper = T.name.wrapper subParms = | |
| subParms num_params = length(T.parameters) |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "apply_type_with_promotion succeeded" TT2=TT2 result_fieldcount=fieldcount(TT2) changed_params=changed_params | |
| @debug "apply_type_with_promotion succeeded" TT2 = TT2 result_fieldcount = fieldcount( | |
| TT2 | |
| ) changed_params = changed_params |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Validating reconstructed type" T=T TT2=TT2 fieldcount_match=(fieldcount(T) == fieldcount(TT2)) | |
| @debug "Validating reconstructed type" T = T TT2 = TT2 fieldcount_match = ( | |
| fieldcount(T) == fieldcount(TT2) | |
| ) |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Field validation" f=f subT=subT subT2=subT2 subTT=subTT match=(subT2==subTT) | |
| @debug "Field validation" f = f subT = subT subT2 = subT2 subTT = subTT match = ( | |
| subT2 == subTT | |
| ) |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Field mismatch detected" f=f expected=subTT got=subT2 | |
| @debug "Field mismatch detected" f = f expected = subTT got = subT2 |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| @debug "Field count mismatch" fieldcount_T=fieldcount(T) fieldcount_TT2=fieldcount(TT2) | |
| @debug "Field count mismatch" fieldcount_T = fieldcount(T) fieldcount_TT2 = fieldcount( | |
| TT2 | |
| ) |
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.
can we add some tests?
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| elseif !ismutabletype(FT) && !ismutabletype(Core.Typeof(xi2)) && fieldcount(FT) == fieldcount(Core.Typeof(xi2)) | |
| elseif !ismutabletype(FT) && | |
| !ismutabletype(Core.Typeof(xi2)) && | |
| fieldcount(FT) == fieldcount(Core.Typeof(xi2)) |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| val_wrapped = Core.Typeof(val_wrapped)((sub_path,), val_wrapped.mlir_data) | |
| val_wrapped = Core.Typeof(val_wrapped)( | |
| (sub_path,), val_wrapped.mlir_data | |
| ) |
Outdated
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.
[JuliaFormatter] reported by reviewdog 🐶
| xi2 = ccall(:jl_new_structv, Any, (Any, Ptr{Any}, UInt32), FT, flds_sub, fieldcount(FT)) | |
| xi2 = ccall( | |
| :jl_new_structv, | |
| Any, | |
| (Any, Ptr{Any}, UInt32), | |
| FT, | |
| flds_sub, | |
| fieldcount(FT), | |
| ) |
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.
[JuliaFormatter] reported by reviewdog 🐶