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
Removal of block spans from trans has ruined lexical block debug info #1694
Comments
…lation time while #1694 is unfixed, and fix stack-exhaustion bug in block parent generation.
I'll look into this first thing next week. It's probably just a matter of using better keys for the blocks. |
I think it's a bit more complicated than that. The block debug info requires a starting line and column for each block, but many of the spans being passed into debuginfo are providing spans for individual ast items within blocks. Furthermore, block debug info refers to parent blocks, which themselves require correct spans. If we can prove that any time we refer to a block, every one of its parent blocks already exist in the metadata cache, we can avoid having to provide spans for all parents as well. |
I don't really know what a reasonable compile time is with The reason this worked at all before was purely by accident -- the spans were being tracked so poorly that a lot of insignificant block contexts ended up with the same span. I've now made it so that every context that corresponds to an actual {} in the source program gets a debuginfo block. But I'm wondering what such blocks add, in terms of useful debuginfo, at all. Maybe we'd be better off simply not bothering with them? |
I'm not certain what LLVM does if the lexical block debug information is not present when dealing only with line numbers, functions and files as -g currently does. For -xg, this information is very important for variable scoping information. |
It looks like the lexical block cache is a huge perf drain in its current naive implementation, due to the number of entries. With the cache disabled (but block debug information generated every time), and reverting the path->id changes from create_function, I see -g taking about 1.6x as long as regular. That seems fine to me right now. |
https://gist.github.com/1701436 is the diff of the changes I made to get the 1.6x build times. |
I.e. a set of curly braces, not everything that creates a block context in the trans pass. Issue #1694
debuginfo was relying on block-level spans to generate proper location information. Now arbitrary non-block spans are being passed instead, causing a proliferation of fake blocks to be created and cached (slowing down debug compilation time by >10x), as well as incorrect debuginfo generation.
The text was updated successfully, but these errors were encountered: