Skip to content
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 a regression in the test for #13432 #55004

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Fix a regression in the test for #13432 #55004

merged 1 commit into from
Jul 5, 2024

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 2, 2024

The test for #13432 is supposed to test a particular codegen path involving Bottom. It turns out that this code path is regressed on master, but hidden by the fact that in modern julia, the optimizer can fold this code path early. Fix the bug and add a variant of the test that shows the issue on julia master. Note that this is both an assertion failure and incorrect codegen. This PR addresses both.

@Keno Keno requested a review from vtjnash July 2, 2024 20:02
The test for #13432 is supposed to test a particular codegen path
involving Bottom. It turns out that this code path is regressed on
master, but hidden by the fact that in modern julia, the optimizer
can fold this code path early. Fix the bug and add a variant of the
test that shows the issue on julia master. Note that this is both
an assertion failure and incorrect codegen. This PR addresses both.
@Keno Keno force-pushed the kf/13432regression branch from 1a6795b to 5e44c0e Compare July 4, 2024 16:18
Value *istype_boxed = ctx.builder.CreateICmpEQ(emit_typeof(ctx, arg.Vboxed, false, true), emit_tagfrom(ctx, dt));
Value *istype_boxed = NULL;
if (is_uniquerep_Type((jl_value_t*)dt)) {
istype_boxed = ctx.builder.CreateICmpEQ(decay_derived(ctx, arg.Vboxed), decay_derived(ctx, literal_pointer_val(ctx, jl_tparam0(dt))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This jl_tparam0 result does not appear to be GC-rooted anywhere, otherwise, SGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should inherit the root from dt.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that makes sense, assuming dt gets a root?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed they were interned, since we make that same assumption elsewhere in codegen. If not, we'll need a bigger change.

@Keno Keno merged commit 5468a3e into master Jul 5, 2024
4 of 7 checks passed
@Keno Keno deleted the kf/13432regression branch July 5, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants