Skip to content

Commit

Permalink
Merge pull request #18520 from JuliaLang/yyc/codegen/coverage
Browse files Browse the repository at this point in the history
Fix coverage of the first statement
  • Loading branch information
vtjnash authored Sep 16, 2016
2 parents dab390c + e4d1462 commit 0408085
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4823,7 +4823,7 @@ static std::unique_ptr<Module> emit_function(jl_method_instance_t *lam, jl_code_
// Whether we are doing codegen in statement order.
// We need to update debug location if this is false even if
// `loc_changed` is false.
bool linear_codegen = false;
bool linear_codegen = true;
auto find_next_stmt = [&] (int seq_next) {
// `seq_next` is the next statement we want to emit
// i.e. if it exists, it's the next one following control flow and
Expand Down Expand Up @@ -4902,18 +4902,11 @@ static std::unique_ptr<Module> emit_function(jl_method_instance_t *lam, jl_code_
(malloc_log_mode == JL_LOG_USER && in_user_code));
};

// If the first expresion changes the line number, we need to visit
// the start of the function. This can happen when the first line is
// a inlined function call.
if (stmtprops[0].loc_changed && coverage_mode != JL_LOG_NONE &&
do_coverage(in_user_mod(ctx.module))) {
// Compute `in_user_code` using `ctx.module` instead of using
// `stmtprops[0].in_user_code` since the code property is for the first
// statement, which might have been a push_loc.
if (ctx.debug_enabled)
builder.SetCurrentDebugLocation(topdebugloc);
// Handle the implicit first line number node.
if (ctx.debug_enabled)
builder.SetCurrentDebugLocation(topdebugloc);
if (coverage_mode != JL_LOG_NONE && do_coverage(in_user_mod(ctx.module)))
coverageVisitLine(filename, toplineno);
}
while (cursor != -1) {
auto &props = stmtprops[cursor];
if ((props.loc_changed || !linear_codegen) && ctx.debug_enabled)
Expand Down

3 comments on commit 0408085

@vtjnash
Copy link
Member Author

Choose a reason for hiding this comment

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

@nanosoldier runbenchmarks(ALL, vs = "dab390ccd2e8d57e7450d72b1c51286530340ae7")

@jrevels
Copy link
Member

Choose a reason for hiding this comment

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

Gotta add an @ before commit SHAs:

@nanosoldier runbenchmarks(ALL, vs = "@dab390ccd2e8d57e7450d72b1c51286530340ae7")

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.