> 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

Reply via email to