-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix codegen for getfield of homogeneous tuples #34208
Conversation
Much thanks for this! I think this is perhaps just a design issue with |
Yes, it would be nice if we could preserve this fast path for the case where the element type is known not to be inlinealloc. |
Co-Authored-By: Jameson Nash <[email protected]>
@@ -7143,7 +7143,12 @@ Base.iterate(s::SplatBadIterate, args...) = () | |||
|
|||
# Issue #34206/34207 | |||
function mre34206(a) | |||
b = ntuple(_ -> view(a, :), 1)[1] | |||
function mre34206(a, n) |
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.
Seems like something went wrong here?
Should |
How about something like this: --- a/src/cgutils.cpp
+++ b/src/cgutils.cpp
@@ -1321,6 +1321,10 @@ static jl_cgval_t typed_load(jl_codectx_t &ctx, Value *ptr, Value *idx_0
Type *elty = julia_type_to_llvm(jltype, &isboxed);
if (type_is_ghost(elty))
return ghostValue(jltype);
+ if (!isboxed && !jl_datatype_isinlinealloc(jltype)) {
+ elty = T_prjlvalue;
+ isboxed = true;
+ }
Type *ptrty = PointerType::get(elty, ptr->getType()->getPointerAddressSpace()); |
This fastpath wasn't checking whether or not the element type
was inline allocated or not.
Fixes #34206
Fixes #34207