This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GOOGLE] Assign discriminators for different callsites at a same line within one BB


> This patch assigns discriminators for different callsites within the
> same BB. This is needed for accurate profile attribution in AutoFDO.
>
> Testing on going.
>
> OK for google branches if test pass?

> +      for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> + {
> +  gimple stmt = gsi_stmt (gsi);
> +  if (gimple_code (stmt) != GIMPLE_CALL)
> +    continue;
> +  if (curr_locus == UNKNOWN_LOCATION ||
> +      !same_line_p (curr_locus, gimple_location (stmt)))
> +    curr_locus = gimple_location (stmt);
> +  else
> +    gimple_set_location (stmt, location_with_discriminator (
> + gimple_location (stmt),
> + next_discriminator_for_locus (gimple_location (stmt))));
> + }

Please add a comment above this block explaining what it's doing. Are
you sure it's sufficient to just assign a new discriminator to the
CALL stmt, and not to the subsequent stmts after the CALL?

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]