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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [ipa-struct-reorg.h] - Diff between revs 280 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 280 Rev 338
/* Struct-reorg optimization.
/* Struct-reorg optimization.
   Copyright (C) 2002, 2003-2007, 2008, 2009 Free Software Foundation, Inc.
   Copyright (C) 2002, 2003-2007, 2008, 2009 Free Software Foundation, Inc.
   Contributed by Olga Golovanevsky <olga@il.ibm.com>
   Contributed by Olga Golovanevsky <olga@il.ibm.com>
 
 
This file is part of GCC.
This file is part of GCC.
 
 
GCC is free software; you can redistribute it and/or modify
GCC is free software; you can redistribute it and/or modify
under the terms of the GNU General Public License as published by
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
(at your option) any later version.
 
 
GCC is distributed in the hope that it will be useful,
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */
<http://www.gnu.org/licenses/>.  */
 
 
#ifndef IPA_STRUCT_REORG_H
#ifndef IPA_STRUCT_REORG_H
#define IPA_STRUCT_REORG_H
#define IPA_STRUCT_REORG_H
 
 
/* This file contains data structures and interfaces required
/* This file contains data structures and interfaces required
   for struct-reorg optimizations.  */
   for struct-reorg optimizations.  */
 
 
/* An access site of the structure field.
/* An access site of the structure field.
   We consider an access to be of the following form:
   We consider an access to be of the following form:
 
 
   D.2166_21 = i.6_20 * 8;
   D.2166_21 = i.6_20 * 8;
   D.2167_22 = (struct str_t *) D.2166_21;
   D.2167_22 = (struct str_t *) D.2166_21;
   D.2168_24 = D.2167_22 + p.5_23;
   D.2168_24 = D.2167_22 + p.5_23;
   D.2169_25 = D.2168_24->b;
   D.2169_25 = D.2168_24->b;
*/
*/
 
 
struct field_access_site
struct field_access_site
{
{
  /* Statement in which the access site occurs.  */
  /* Statement in which the access site occurs.  */
  gimple stmt;           /* D.2169_25 = D.2168_24->b;  */
  gimple stmt;           /* D.2169_25 = D.2168_24->b;  */
  tree comp_ref;         /* D.2168_24->b  */
  tree comp_ref;         /* D.2168_24->b  */
  tree field_decl;       /* b */
  tree field_decl;       /* b */
  tree ref;              /* D.2168_24  */
  tree ref;              /* D.2168_24  */
  tree num;              /* i.6_20  */
  tree num;              /* i.6_20  */
  tree offset;           /* D2167_22  */
  tree offset;           /* D2167_22  */
  tree base;             /* p.5_23  */
  tree base;             /* p.5_23  */
  gimple ref_def_stmt;   /* D.2168_24 = D.2167_22 + p.5_23;  */
  gimple ref_def_stmt;   /* D.2168_24 = D.2167_22 + p.5_23;  */
  gimple cast_stmt;      /* D.2167_22 = (struct str_t *) D.2166_21;
  gimple cast_stmt;      /* D.2167_22 = (struct str_t *) D.2166_21;
                            This statement is not always present.  */
                            This statement is not always present.  */
};
};
 
 
/* A non-field structure access site.  */
/* A non-field structure access site.  */
struct access_site
struct access_site
{
{
  /* A statement in which the access site occurs.  */
  /* A statement in which the access site occurs.  */
  gimple stmt;
  gimple stmt;
  /* A list of structure variables in the access site.  */
  /* A list of structure variables in the access site.  */
  VEC (tree, heap) *vars;
  VEC (tree, heap) *vars;
};
};
 
 
/* A field of the structure.  */
/* A field of the structure.  */
struct field_entry
struct field_entry
{
{
  /* A field index.  */
  /* A field index.  */
  int index;
  int index;
  /* Number of times the field is accessed (according to profiling).  */
  /* Number of times the field is accessed (according to profiling).  */
  gcov_type count;
  gcov_type count;
  tree decl;
  tree decl;
  /* A type of a new structure this field belongs to.  */
  /* A type of a new structure this field belongs to.  */
  tree field_mapping;
  tree field_mapping;
  htab_t acc_sites;
  htab_t acc_sites;
};
};
 
 
/* This structure represents a result of the structure peeling.
/* This structure represents a result of the structure peeling.
   The original structure is decomposed into substructures, or clusters.  */
   The original structure is decomposed into substructures, or clusters.  */
struct field_cluster
struct field_cluster
{
{
  /* A bitmap of field indices. The set bit indicates that the field
  /* A bitmap of field indices. The set bit indicates that the field
     corresponding to it is a part of this cluster.  */
     corresponding to it is a part of this cluster.  */
  sbitmap fields_in_cluster;
  sbitmap fields_in_cluster;
  struct field_cluster *sibling;
  struct field_cluster *sibling;
};
};
 
 
/* An information about an individual structure type (RECORD_TYPE) required
/* An information about an individual structure type (RECORD_TYPE) required
   by struct-reorg optimizations to perform a transformation.  */
   by struct-reorg optimizations to perform a transformation.  */
struct data_structure
struct data_structure
{
{
 
 
  /* A main variant of the structure type.  */
  /* A main variant of the structure type.  */
  tree decl;
  tree decl;
 
 
  /* Number of fields in the structure.  */
  /* Number of fields in the structure.  */
  int num_fields;
  int num_fields;
 
 
  /* A structure access count collected through profiling.  */
  /* A structure access count collected through profiling.  */
  gcov_type count;
  gcov_type count;
 
 
  /* An array of the structure fields, indexed by field ID.  */
  /* An array of the structure fields, indexed by field ID.  */
  struct field_entry *fields;
  struct field_entry *fields;
 
 
  /* Non-field accesses of the structure.  */
  /* Non-field accesses of the structure.  */
  htab_t accs;
  htab_t accs;
 
 
  /* A data structure representing a reorganization decision.  */
  /* A data structure representing a reorganization decision.  */
  struct field_cluster *struct_clustering;
  struct field_cluster *struct_clustering;
 
 
  /* New types to replace the original structure type.  */
  /* New types to replace the original structure type.  */
  VEC(tree, heap) *new_types;
  VEC(tree, heap) *new_types;
};
};
 
 
typedef struct data_structure * d_str;
typedef struct data_structure * d_str;
 
 
#endif /* IPA_STRUCT_REORG_H */
#endif /* IPA_STRUCT_REORG_H */
 
 

powered by: WebSVN 2.1.0

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