OSDN Git Service

* value-prof.c: New.
[pf3gnuchains/gcc-fork.git] / gcc / value-prof.h
1 /* Definitions for transformations based on profile information for values.
2    Copyright (C) 2003 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING.  If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.  */
20
21 /* Supported histogram types.  */
22 enum hist_type
23 {
24   HIST_TYPE_INTERVAL,   /* Measures histogram of values inside a specified
25                            interval.  */
26   HIST_TYPE_POW2,       /* Histogram of power of 2 values.  */
27   HIST_TYPE_SINGLE_VALUE, /* Tries to identify the value that is (almost)
28                            always constant.  */
29   HIST_TYPE_CONST_DELTA /* Tries to identify the (almost) always constant
30                            difference between two evaluations of a value.  */
31 };
32
33 /* The value to measure.  */
34 struct histogram_value
35 {
36   rtx value;            /* The value to profile.  */
37   enum machine_mode mode; /* And its mode.  */
38   rtx seq;              /* Insns requiered to count the profiled value.  */
39   rtx insn;             /* Insn before that to measure.  */
40   enum hist_type type;  /* Type of information to measure.  */
41   unsigned n_counters;  /* Number of requiered counters.  */
42   union
43     {
44       struct
45         {
46           int int_start;        /* First value in interval.  */
47           int steps;            /* Number of values in it.  */
48           int may_be_less;      /* May the value be below?  */
49           int may_be_more;      /* Or above.  */
50         } intvl;        /* Interval histogram data.  */
51       struct
52         {
53           int may_be_other;     /* If the value may be non-positive or not 2^k.  */
54         } pow2;         /* Power of 2 histogram data.  */
55     } hdata;            /* Profiled information specific data.  */
56 };
57
58 extern void find_values_to_profile (unsigned *, struct histogram_value **);
59 extern void free_profiled_values (unsigned, struct histogram_value *);