-
Notifications
You must be signed in to change notification settings - Fork 69
Avoid recursive store for String #2263
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 all commits
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 |
---|---|---|
|
@@ -603,7 +603,7 @@ function julia_undef_value_for_type( | |
end | ||
|
||
function create_recursive_stores(B::LLVM.IRBuilder, @nospecialize(Ty::DataType), @nospecialize(prev::LLVM.Value))::Nothing | ||
if Base.datatype_pointerfree(Ty) | ||
if Base.datatype_pointerfree(Ty) || Base.datatype_fieldcount(Ty) == 0 | ||
return | ||
end | ||
|
||
|
@@ -647,7 +647,7 @@ function create_recursive_stores(B::LLVM.IRBuilder, @nospecialize(Ty::DataType), | |
LLVM.Value[LLVM.ConstantInt(Int64(off))], | ||
) | ||
|
||
fallback = Base.isabstracttype(Ty2) || Ty2 isa Union | ||
fallback = Base.isabstracttype(Ty2) || Ty2 isa Union || Base.datatype_fieldcount(Ty2) == 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so I'm not sure this is right. Essentially this is checking whether the inline-data field type can be initialized as a null jlvaluet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I understand. This does mean that Is not correct either, since the field descriptor of the parent wouldn't contain the information that this field may be undefined. E.g. We would need to store a reference to a In Julia one can only have unintialized fields at the end of the layout. We statically look at the constructor to determine which fields may be uninitialized.
We mark the return and the load as non-null. Whereas:
So if we may or may not initialize a value as null jl_value_t depends not on the value, but on the layout of the parent. |
||
|
||
@static if VERSION < v"1.11-" | ||
fallback |= Ty2 <: Array | ||
|
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 I think is fine though