On 07/01/2013 12:59 PM, David Malcolm wrote:
> I tried this approach for tracer, but there were non-trivial differences
> between the old and new tracer.o files, enough to make me uncomfortable
> with this approach.

Like what?  Are these just bugs in the IPA-CP pass failing to propagate?  If
so, we should file bugs against it.


> +++ b/gcc/tracer.c
> @@ -53,20 +53,39 @@
>  static int count_insns (basic_block);
>  static bool ignore_bb_p (const_basic_block);
>  static bool better_p (const_edge, const_edge);
> -static edge find_best_successor (basic_block);
> -static edge find_best_predecessor (basic_block);
> -static int find_trace (basic_block, basic_block *);
>  
> -/* Minimal outgoing edge probability considered for superblock formation.  */
> -static int probability_cutoff;
> -static int branch_ratio_cutoff;
> +/* Internal state of one invocation of the tracer pass.  */
>  
> -/* A bit BB->index is set if BB has already been seen, i.e. it is
> -   connected to some trace already.  */
> -sbitmap bb_seen;
> -
> -static inline void
> -mark_bb_seen (basic_block bb)
> +class tracer_state
> +{
> +public:
> +  static bool tail_duplicate ();
> +
> +private:
> +  static void mark_bb_seen (basic_block);
> +  static bool bb_seen_p (basic_block);
> +  static edge find_best_successor (basic_block);
> +  static edge find_best_predecessor (basic_block);
> +  static int find_trace (basic_block, basic_block *);
> +

Regardless, the new class should still be in an anonymous namespace, so that
all the member functions remain private to the translation unit.


r~

Reply via email to