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 * Module: xstats.h 00042 * $Revision$ 00043 * $Date$ 00044 * $Author$ 00045 * $Source$ 00046 * 00047 * Description: 00048 * 00049 * Interface for statistics collection in the compiler core. 00050 * 00051 * ==================================================================== 00052 * ==================================================================== 00053 */ 00054 00055 #ifdef _KEEP_RCS_ID 00056 static char *xstats_rcs_id = "$Source$ $Revision$"; 00057 #endif /* _KEEP_RCS_ID */ 00058 00059 #include "opcode.h" 00060 #if 0 // SC 00061 #include "wn_core.h" 00062 #endif 00063 00064 #ifdef __cplusplus 00065 extern "C" { 00066 #endif 00067 00068 /* 00069 * Compute the PU Olimit. 00070 * WARNING: This computation may change! 00071 * The WOPT algorithm is #bbs * #stmts * #vars 00072 * CG has some algorithms that are n^2 on #bbs 00073 * As a simple approximation, and to keep things to a single number, 00074 * just use 2*#bbs + #stmts 00075 */ 00076 #define COMPUTE_OLIMIT(b,s) (b + b + s) 00077 #define COMPUTE_PU_OLIMIT \ 00078 PU_Olimit = COMPUTE_OLIMIT(PU_WN_BB_Cnt, PU_WN_Stmt_Cnt); \ 00079 Max_Src_Olimit = MAX(Max_Src_Olimit,PU_Olimit) 00080 00081 extern UINT32 PU_Olimit; /* Olimit computed for PU */ 00082 extern UINT32 Max_Src_Olimit; /* Maximum Olimit needed for all PU's in file */ 00083 00084 /* Counters of important data structures */ 00085 extern INT32 PU_WN_Cnt; /* number of whirl nodes in this PU */ 00086 extern INT32 PU_WN_BB_Cnt; /* number of whirl bbs in this PU */ 00087 extern INT32 PU_WN_Stmt_Cnt; /* number of whirl stmts in this PU */ 00088 extern INT32 PU_WN_Call_Cnt; /* number of whirl calls in this PU */ 00089 extern INT32 PU_WN_Loop_Cnt; /* number of whirl loops in this PU */ 00090 extern INT32 PU_BB_Cnt; /* number of cg basic-blocks in this PU */ 00091 extern INT32 PU_OP_Cnt; /* number of instructions in this PU */ 00092 extern INT32 PU_Size; /* number of bytes in this PU */ 00093 extern INT32 PU_TN_Cnt; /* number of TNs in this PU */ 00094 00095 /* Counters for back end: */ 00096 extern INT32 Misaligned_Cnt; /* Number of misaligned memrefs expanded */ 00097 extern INT32 Temp_Var_Cnt; /* Number of tempories created */ 00098 extern INT32 Spill_Var_Cnt; /* Number of spill temporaries created */ 00099 00100 #if 0 // SC 00101 /* Publicly visible functions */ 00102 00103 extern void Initialize_Stats(void); 00104 extern void Initialize_PU_Stats(void); 00105 extern void Print_PU_Stats(void); 00106 extern void Print_Total_Stats(void); 00107 00108 /* determine # bbs and stmts to be counted for the opcode; 00109 * the bbs and stmts parameters are incremented. */ 00110 extern void Count_WN_Node (WN *node, INT32 *bbs, INT32 *stmts); 00111 extern void Count_WN_Operator (OPERATOR opr, TYPE_ID rtype, INT32& bbs, 00112 INT32& stmts, INT32& calls); 00113 inline void 00114 Count_WN_Opcode (OPCODE opcode, INT32* bbs, INT32* stmts) 00115 { 00116 Count_WN_Operator (OPCODE_operator (opcode), OPCODE_rtype (opcode), 00117 *bbs, *stmts, PU_WN_Call_Cnt); 00118 } 00119 #endif // SC 00120 00121 #ifdef __cplusplus 00122 } 00123 #endif 00124 #endif /* xstats_INCLUDED */
1.5.6