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 recent CI compile time perf regression #22912

Merged
merged 3 commits into from
Jul 22, 2017
Merged

Fix recent CI compile time perf regression #22912

merged 3 commits into from
Jul 22, 2017

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 21, 2017

The second commit here fixes the actual regression. The first addresses some of the low hanging fruits that were suggested on the review of the original PR. The third adds a helpful command line option to dump the IR that the frontend generated while running some code. Together with opt -time-passes that's very useful for tracking down perf problems.

Keno added 2 commits July 21, 2017 19:09
Avoid doing some redundant work/copying. Cleanup formatting.
My misrememberance of how the C++ STL works caused us to insert way
too many stores here. This fixes the recent compile time performance
regressions observed on CI.
@@ -191,6 +193,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
{ "check-bounds", required_argument, 0, opt_check_bounds },
{ "output-bc", required_argument, 0, opt_output_bc },
{ "output-unopt-bc", required_argument, 0, opt_output_unopt_bc },
{ "output-jit-bc", required_argument, 0, opt_output_jit_bc },
Copy link
Contributor

Choose a reason for hiding this comment

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

// NOTE: This set of required arguments need to be kept in sync
// with the required arguments defined in base/client.jl `process_options()`

and the man page and command-line flags docs

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this and the --output-unopt-bc are for developer debugging purposes only, I think I'll remove it from the help text and document it in the devdocs.

@@ -947,7 +947,7 @@ void* jl_get_globalvar(GlobalVariable *gv)
void jl_add_to_shadow(Module *m)
{
#ifndef KEEP_BODIES
if (!imaging_mode)
if (!imaging_mode && !jl_options.outputjitbc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do/can we also have this as an option to code llvm?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what you're asking for

Copy link
Contributor

Choose a reason for hiding this comment

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

an code_llvm option that does not run optimization passes on it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, we do have that, but you need to call _dump_function directly I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I thought I saw it being added but couldn't find it in code_llvm.

Copy link
Member Author

Choose a reason for hiding this comment

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

Read the devdocs ;) - It's actually documented in the llvm ones.

This option is useful for tracing all the llvm IR generating during
JITting and running it through opt, e.g. to track down compile time
performance regressions.
@ararslan ararslan added ci Continuous integration GC Garbage collector performance Must go faster labels Jul 21, 2017
@tkelman
Copy link
Contributor

tkelman commented Jul 22, 2017

Great, the sparse/cholmod test is back under a minute like it should be.

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

lgtm

# This runs early in the sysimage != is not defined yet
if sizeof(JLOptions) === ccall(:jl_sizeof_jl_options, Int, ())
else
ccall(:jl_throw, Void, (Any,), "Option structure mismatch")
Copy link
Member

Choose a reason for hiding this comment

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

throw is a builtin function. you could ccall jl_error here to get the right Exception type, or just call throw

@JeffBezanson
Copy link
Member

Ready to merge?

@Keno
Copy link
Member Author

Keno commented Jul 22, 2017

Yes, I'll do the cleanup suggested by Jameson in a separate PR to avoid holding up this fix.

@Keno Keno merged commit 0b95a5d into master Jul 22, 2017
@martinholters martinholters deleted the kf/fixciregresssion branch July 22, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration GC Garbage collector performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants