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

Improve generated debug info to avoid assertion in SROA #13762

Merged
merged 1 commit into from
Oct 30, 2015
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented Oct 25, 2015

This is a very simple start on emitting more thorough debug info. I was planning (and still am) to work on this as part of a larger push to improve our generated debug info, but at the moment SROA is crashing on 3.7 (#13754), because our debug info is not quite valid. Interestingly, I can still see a crash if I run the system image that results from this through bugpoint, the optimizer still crashes, so we might be hitting another LLVM bug here. Bootstrap goes through fine with this though.

@Keno
Copy link
Member Author

Keno commented Oct 25, 2015

Turns out it just runs through the memory cap trying to optimize the system image ;).

@yuyichao
Copy link
Contributor

So the "LLVM bug" is that they didn't buy you more memory ;-p

Thanks for the fix. I can confirm that this indeed fixes the bootstrap failure on linux too.

@Keno
Copy link
Member Author

Keno commented Oct 25, 2015

Not quite. The problem is that bugpoint limits executions of the optimizer to 400MB, the machine has plenty of RAM.

@yuyichao
Copy link
Contributor

The problem is that bugpoint limits executions of the optimizer to 400MB

I remember you said "LLVM does not keep such counts". Is this a recent improvement (that we could use for benchmarking) or is it just running it in a separate process and let the OS take care of it (e.g. with ulimit).

@Keno
Copy link
Member Author

Keno commented Oct 26, 2015

Yes, it's using ulimit -v on an optimizer subprocess.

@Keno
Copy link
Member Author

Keno commented Oct 26, 2015

Hmm, looks like we have a non-deterministic test failure here :(. Will see if I can reproduce.

@@ -4569,7 +4569,7 @@ static Function *emit_function(jl_lambda_info_t *lam)
s->name, // Variable name
topfile, // File
toplineno == -1 ? 0 : toplineno, // Line (for now, use lineno of the function)
julia_type_to_di(varinfo.value.typ, ctx.dbuilder, specsig), // Variable type
julia_type_to_di(varinfo.value.typ, ctx.dbuilder, varinfo.value.isboxed), // Variable type
Copy link
Member

Choose a reason for hiding this comment

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

isboxed isn't really well defined for varinfo.value, but regardless, it hasn't been assigned yet here. i'm not certain that this is what you want here anyways. I think you want to check after emitting the function whether a memloc needed to be created for this variable, or whether it was allocated in .value and whether varinfo.value.typ is a known type or not.

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'm considering always passing false here and handing this at the callsite.

@tkelman tkelman added the compiler:codegen Generation of LLVM IR and native code label Oct 26, 2015
@Keno
Copy link
Member Author

Keno commented Oct 30, 2015

Ok, now passing false everywhere to always describe the actual type rather than the box. Note that I actually found a bug in LLVM where it would mis-lower our debug info (http://reviews.llvm.org/D14186), which however I don't think should cause any crashes, just wrong debug info.

@tkelman
Copy link
Contributor

tkelman commented Oct 30, 2015

Does this fix #13754? Is it okay to merge?

@yuyichao
Copy link
Contributor

This does fix #13754 for me.

Keno added a commit that referenced this pull request Oct 30, 2015
Improve generated debug info to avoid assertion in SROA
@Keno Keno merged commit d0f9e12 into master Oct 30, 2015
@tkelman tkelman deleted the kf/improvedi branch October 30, 2015 21:03
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants