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