Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
xstats.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 #ifndef xstats_INCLUDED
00037 #define xstats_INCLUDED
00038 /* ====================================================================
00039  * ====================================================================
00040  *
00041  *
00042  * Description:
00043  *
00044  * Interface for statistics collection in the compiler core.
00045  *
00046  * ====================================================================
00047  * ====================================================================
00048  */
00049 
00050 #ifdef _KEEP_RCS_ID
00051 #endif /* _KEEP_RCS_ID */
00052 
00053 #include "opcode.h"
00054 #include "wn_core.h"
00055 
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059 
00060 /*
00061  * Compute the PU Olimit.
00062  * WARNING:  This computation may change!
00063  * The WOPT algorithm is #bbs * #stmts * #vars
00064  * CG has some algorithms that are n^2 on #bbs
00065  * As a simple approximation, and to keep things to a single number,
00066  * just use 2*#bbs + #stmts
00067  */
00068 #define COMPUTE_OLIMIT(b,s)     (b + b + s)
00069 #define COMPUTE_PU_OLIMIT       \
00070         PU_Olimit = COMPUTE_OLIMIT(PU_WN_BB_Cnt, PU_WN_Stmt_Cnt); \
00071         Max_Src_Olimit = MAX(Max_Src_Olimit,PU_Olimit)
00072 
00073 extern UINT32 PU_Olimit;        /* Olimit computed for PU */
00074 extern UINT32 Max_Src_Olimit;   /* Maximum Olimit needed for all PU's in file */
00075 
00076 /* Counters of important data structures */
00077 extern INT32 PU_WN_Cnt;         /* number of whirl nodes in this PU */
00078 extern INT32 PU_WN_BB_Cnt;      /* number of whirl bbs in this PU */
00079 extern INT32 PU_WN_Stmt_Cnt;    /* number of whirl stmts in this PU */
00080 extern INT32 PU_WN_Call_Cnt;    /* number of whirl calls in this PU */
00081 extern INT32 PU_WN_Loop_Cnt;    /* number of whirl loops in this PU */
00082 extern INT32 PU_BB_Cnt;         /* number of cg basic-blocks in this PU */
00083 extern INT32 PU_OP_Cnt;         /* number of instructions in this PU */
00084 extern INT32 PU_Size;           /* number of bytes in this PU */
00085 extern INT32 PU_TN_Cnt;         /* number of TNs in this PU */
00086 
00087 /* Counters for back end: */
00088 extern INT32 Misaligned_Cnt;    /* Number of misaligned memrefs expanded */
00089 extern INT32 Temp_Var_Cnt;      /* Number of tempories created */
00090 extern INT32 Spill_Var_Cnt;     /* Number of spill temporaries created */
00091 
00092 /* Publicly visible functions */
00093 
00094 extern void Initialize_Stats(void);
00095 extern void Initialize_PU_Stats(void);
00096 extern void Print_PU_Stats(void);
00097 extern void Print_Total_Stats(void);
00098 
00099 /* determine # bbs and stmts to be counted for the opcode;
00100  * the bbs and stmts parameters are incremented. */
00101 extern void Count_WN_Node (WN *node, INT32 *bbs, INT32 *stmts);
00102 extern void Count_WN_Operator (OPERATOR opr, TYPE_ID rtype, INT32& bbs,
00103                                INT32& stmts, INT32& calls);
00104 inline void
00105 Count_WN_Opcode (OPCODE opcode, INT32* bbs, INT32* stmts)
00106 {
00107     Count_WN_Operator (OPCODE_operator (opcode), OPCODE_rtype (opcode),
00108                        *bbs, *stmts, PU_WN_Call_Cnt);
00109 }
00110 
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115 #endif /* xstats_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines