OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [value-prof.h] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* Definitions for transformations based on profile information for values.
2
   Copyright (C) 2003, 2004, 2005, 2007 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 3, 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 COPYING3.  If not see
18
<http://www.gnu.org/licenses/>.  */
19
 
20
#ifndef GCC_VALUE_PROF_H
21
#define GCC_VALUE_PROF_H
22
 
23
/* Supported histogram types.  */
24
enum hist_type
25
{
26
  HIST_TYPE_INTERVAL,   /* Measures histogram of values inside a specified
27
                           interval.  */
28
  HIST_TYPE_POW2,       /* Histogram of power of 2 values.  */
29
  HIST_TYPE_SINGLE_VALUE, /* Tries to identify the value that is (almost)
30
                           always constant.  */
31
  HIST_TYPE_CONST_DELTA /* Tries to identify the (almost) always constant
32
                           difference between two evaluations of a value.  */
33
};
34
 
35
#define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER)
36
#define HIST_TYPE_FOR_COUNTER(COUNTER) \
37
  ((enum hist_type) ((COUNTER) - GCOV_FIRST_VALUE_COUNTER))
38
 
39
/* The value to measure.  */
40
struct histogram_value_t
41
{
42
  struct
43
    {
44
      tree value;               /* The value to profile.  */
45
      tree stmt;                /* Insn containing the value.  */
46
      gcov_type *counters;                      /* Pointer to first counter.  */
47
      struct histogram_value_t *next;           /* Linked list pointer.  */
48
    } hvalue;
49
  enum hist_type type;                  /* Type of information to measure.  */
50
  unsigned n_counters;                  /* Number of required counters.  */
51
  union
52
    {
53
      struct
54
        {
55
          int int_start;        /* First value in interval.  */
56
          unsigned int steps;   /* Number of values in it.  */
57
        } intvl;        /* Interval histogram data.  */
58
    } hdata;            /* Profiled information specific data.  */
59
};
60
 
61
typedef struct histogram_value_t *histogram_value;
62
 
63
DEF_VEC_P(histogram_value);
64
DEF_VEC_ALLOC_P(histogram_value,heap);
65
 
66
typedef VEC(histogram_value,heap) *histogram_values;
67
 
68
/* Hooks registration.  */
69
extern void tree_register_value_prof_hooks (void);
70
 
71
/* IR-independent entry points.  */
72
extern void find_values_to_profile (histogram_values *);
73
extern bool value_profile_transformations (void);
74
 
75
/* External declarations for edge-based profiling.  */
76
struct profile_hooks {
77
 
78
  /* Insert code to initialize edge profiler.  */
79
  void (*init_edge_profiler) (void);
80
 
81
  /* Insert code to increment an edge count.  */
82
  void (*gen_edge_profiler) (int, edge);
83
 
84
  /* Insert code to increment the interval histogram counter.  */
85
  void (*gen_interval_profiler) (histogram_value, unsigned, unsigned);
86
 
87
  /* Insert code to increment the power of two histogram counter.  */
88
  void (*gen_pow2_profiler) (histogram_value, unsigned, unsigned);
89
 
90
  /* Insert code to find the most common value.  */
91
  void (*gen_one_value_profiler) (histogram_value, unsigned, unsigned);
92
 
93
  /* Insert code to find the most common value of a difference between two
94
     evaluations of an expression.  */
95
  void (*gen_const_delta_profiler) (histogram_value, unsigned, unsigned);
96
};
97
 
98
/* In profile.c.  */
99
extern void init_branch_prob (void);
100
extern void branch_prob (void);
101
extern void end_branch_prob (void);
102
extern void tree_register_profile_hooks (void);
103
 
104
/* In tree-profile.c.  */
105
extern struct profile_hooks tree_profile_hooks;
106
 
107
#endif  /* GCC_VALUE_PROF_H */
108
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.