This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Assign discriminators for different callsites at a same line within one BB
- From: Cary Coutant <ccoutant at google dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Aug 2013 14:54:29 -0700
- Subject: Re: [GOOGLE] Assign discriminators for different callsites at a same line within one BB
- References: <CAO2gOZVDKViyW68PkSjDCnx5qwK5LJo93unhvrRqjG73EV2gRA at mail dot gmail dot com>
> 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