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 inlined line numbers #14949

Closed
wants to merge 3 commits into from
Closed

Improve inlined line numbers #14949

wants to merge 3 commits into from

Conversation

carnaval
Copy link
Contributor

@carnaval carnaval commented Feb 5, 2016

  • start to remove filenames from line number nodes
  • get closer to remove the "old" Expr(:line, ...) form
  • improve dwarf generation for inline function line numbers
    (get closer to what clang does)

I didn't check for regressions and sysimg size yet. Also the patch needs the frontend improvements from Jeff to remove filenames from the AST entierely (according to him, should be done today).

Probably not working on anything else than LLVM 3.7, I don't feel like fighting my way through the ifdef jungle just yet. Shouldn't we delete everything older than 3.7 now anyway ?

@vtjnash
Copy link
Member

vtjnash commented Feb 5, 2016

Shouldn't we delete everything older than 3.7 now anyway ?

not until it is equally performant. otherwise, how would you know when you succeed?

@carnaval
Copy link
Contributor Author

carnaval commented Feb 8, 2016

It's starting to look ok. It handles arbitrary nested inlined functions, output the correct lambda infos and spec types.

The way it does it is kind of hacky but LLVM's dwarf reader does not make it possible to easily access custom argument so we store some things in the inlined function name.

The only case that does not work is when we do single expression inlining, we'll wait for the linear IR which solves it by definition.

@vtjnash
Copy link
Member

vtjnash commented Feb 28, 2016

what's the status of this / what does it still need to be merged?

@ViralBShah
Copy link
Member

We could delete everything but LLVM 3.3 and 3.7 support.

@carnaval
Copy link
Contributor Author

@Keno alright, it's rebased on top of your cleanup of those horrible files (that was painful, but I agree it's nicer now)

It's still missing a couple things :

  • put back support for file name changing in the middle of a function because of macros (the inlining case works of course since that was the whole point)
  • fix the build for llvm < 3.7
  • use the constant table index of the lambda instead of decompressing the ast for the lookup

The dwarf structure should look ok though, but I only looked at the llvm DI side of things, not at dwarfdump yet. Please do check that it behaves better if you're in the process of parsing the dwarf for the debugger anyway :-)

@@ -240,7 +240,7 @@ static int OpInfoLookup(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Si
size_t inlinedat_line;
jl_lambda_info_t *outer_linfo;
int fromC;
jl_getFunctionInfo(&name, &filename, &line, &inlinedat_file, &inlinedat_line, &outer_linfo, pointer, &fromC, skipC, 1);
//jl_getFunctionInfo(&name, &filename, &line, &inlinedat_file, &inlinedat_line, &outer_linfo, pointer, &fromC, skipC, 1);
Copy link
Member

Choose a reason for hiding this comment

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

?

@Keno
Copy link
Member

Keno commented Mar 18, 2016

Whitespace in source file is killing CI.

@JeffBezanson
Copy link
Member

Could these be called push_loc and pop_loc instead of push_lambda? For macro locations we would need to put in a file name instead of a LambdaInfo.

@JeffBezanson
Copy link
Member

Also, please merge as soon as you can and I'll fix macro line numbers after.

@JeffBezanson JeffBezanson mentioned this pull request Mar 22, 2016
4 tasks
@carnaval carnaval force-pushed the ob/dwarf-inline branch 3 times, most recently from 936bd32 to b1c9f7d Compare March 25, 2016 18:53
@carnaval
Copy link
Contributor Author

alright this is now on top of jb/linear3 and uses a field in the linfo as we discussed.

still need to fix llvm 3.3 build I think, let's first see what CI says about that

@carnaval
Copy link
Contributor Author

(teaser

ERROR: LoadError: hi
 in f(::Int64, ::Bool) at /home/carnaval/dev/julia/repro2.jl:5 [inlined]
 in g(::Int64, ::Bool) at /home/carnaval/dev/julia/repro2.jl:13 [inlined]
 in h(::Bool) at /home/carnaval/dev/julia/repro2.jl:19

with all three frames from the same physical function)

@yuyichao
Copy link
Contributor

(

hi

Oscar's favorate English word =D )

This is awesome!

@carnaval carnaval force-pushed the ob/dwarf-inline branch 2 times, most recently from 4f31caa to 9ab0f11 Compare March 25, 2016 19:22
@vtjnash
Copy link
Member

vtjnash commented Mar 26, 2016

fixes #13725

@Keno
Copy link
Member

Keno commented Mar 29, 2016

@JeffBezanson @carnaval Can we get this merged soon?

@carnaval
Copy link
Contributor Author

well it needs jb/linear3 to be merged first, and it's also broken unfortunately. Apart from at least a bug, keeping all those lambdas around is also putting quite a strain on the serializer apparently :/ I'm having a look.

@JeffBezanson
Copy link
Member

Ok, let's merge jb/linear3 today.

@JeffBezanson
Copy link
Member

Ok, done.

@JeffBezanson
Copy link
Member

Any update here?

@vtjnash
Copy link
Member

vtjnash commented Apr 4, 2016

we're retiring workers much faster, so it appears that memory usage is a fair bit higher. with the latest change, it looks like we are just barely able to sneak this through CI, but two of the tests need to be updated for the changes.

@tkelman
Copy link
Contributor

tkelman commented Apr 4, 2016

Note that the 32 bit linux buildbot has been running out of memory for several days, preventing the build of (gallium-compatible) nightlies. Would like to avoid making it any worse.

Will also need some squashing cleanup.

@carnaval
Copy link
Contributor Author

carnaval commented Apr 4, 2016

yeah all those temporary commits are just to try and see if the mem usage actually improves as I fix things, will squash.

I'm also planning to investigate more closely why, for example, linalg/triangular needs 1GB of resident memory (even on master) and I don't think generated code is the only culprit. We'll see.

@vtjnash
Copy link
Member

vtjnash commented Apr 4, 2016

Note that the 32 bit linux buildbot has been running out of memory for several days, preventing the build of (gallium-compatible) nightlies. Would like to avoid making it any worse.

would be good to open these observations as issues (most of us don't watch the buildbots too closely). It looks like the last successful build was the merge commit for #15609. the next commits were trivial cleanup, so I'm thinking jb/linear3 seems to be the smoking gun here?

@tkelman
Copy link
Contributor

tkelman commented Apr 4, 2016

Yes I think that's right. There was one later successful build which threw me off.

@tkelman
Copy link
Contributor

tkelman commented Apr 6, 2016

I managed to fix the issue for now by rebooting that specific build worker. I think what happened is extra julia processes were accumulating and not getting killed properly when jobs timed out. Don't know whose bug that is, but it's okay for now.

@carnaval carnaval force-pushed the ob/dwarf-inline branch 4 times, most recently from f90e28d to ea72622 Compare April 15, 2016 10:43
#ifdef _OS_DARWIN_
#define MAP_ANONYMOUS MAP_ANON
#endif
uint8_t *juliaAllocateSection(uintptr_t size, unsigned align, section_type typ)
Copy link
Member

Choose a reason for hiding this comment

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

this seems unrelated to the PR, can it be pulled out into a separate commit?

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.

7 participants