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 compile=all and codegen bugs #22697

Merged
merged 1 commit into from
Jul 18, 2017
Merged

fix compile=all and codegen bugs #22697

merged 1 commit into from
Jul 18, 2017

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jul 6, 2017

fixes various issues that have bitrotted a bit since compile=all testing is not being done on CI.

@vtjnash vtjnash added backport pending 0.6 kind:bugfix This change fixes an existing bug compiler:codegen Generation of LLVM IR and native code labels Jul 6, 2017
@@ -480,7 +480,7 @@ static Value *runtime_apply_type(jl_codectx_t &ctx, jl_value_t *ty, jl_unionall_
args[1] = literal_pointer_val(ctx, (jl_value_t*)ctx.linfo->def.method->sig);
args[2] = ctx.builder.CreateInBoundsGEP(
T_prjlvalue,
emit_bitcast(ctx, decay_derived(ctx.spvals_ptr), T_pprjlvalue),
ctx.spvals_ptr,
Copy link
Member

Choose a reason for hiding this comment

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

Are these guaranteed to be globally rooted?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

They're always callee rooted

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Is it OK to just assert that the argument type is T_pprjlvalue?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Ping @Keno

Copy link
Member

Choose a reason for hiding this comment

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

I think you still need to decay_derived at the very least.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

On what?

Copy link
Member

Choose a reason for hiding this comment

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

ctx.spvals_ptr

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

It can just be considered an opaque (callee-rooted) pointer Type::getPointerTo(Void, 0). Unless the rooting pass cares that I'm loading a T_prjlvalue from it?

Copy link
Member

Choose a reason for hiding this comment

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

Ok, as long as ctx.spvals_ptr is in addrspace(0) it's probably fine. The pass will just not root any values you load from it.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

That should be fine (preferred, actually). I assume it'll still wb them if they escape?

@ViralBShah
Copy link
Member

Is there a test we can meaningfully run as part of CI?

@ViralBShah
Copy link
Member

Clearly building the system image and gadfly will kill CI.

@ViralBShah
Copy link
Member

Will this fix #22569 or it's only a part of the fix? If it is the full fix, I can try this branch.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Jul 10, 2017

Yes, I have built Gadfly with this

@ViralBShah
Copy link
Member

Would be nice to get this merged to enable compile testing of more codes.

@vtjnash vtjnash merged commit bdfe92f into master Jul 18, 2017
@vtjnash vtjnash deleted the jn/compiler-fixup branch July 18, 2017 15:29
@tkelman tkelman added the needs tests Unit tests are required for this change label Jul 18, 2017
@@ -994,7 +994,6 @@ export
# loading source files
__precompile__,
evalfile,
include,
Copy link
Contributor

Choose a reason for hiding this comment

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

what?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

This wasn't supposed to be exported – it causes binding overwrite warnings when you try to extend the system image with compile all.

Copy link
Contributor

Choose a reason for hiding this comment

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

could have mentioned that in the commit message or PR description, I suspect that's totally unclear to anyone other than you

ararslan pushed a commit that referenced this pull request Sep 11, 2017
fix compile=all and codegen bugs

Ref #22697
(cherry picked from commit bdfe92f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code kind:bugfix This change fixes an existing bug needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants