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 //-*-c++-*- 00037 //===================================================================== 00038 // 00039 // Module: rbi.h 00040 // $Revision: 1.2 $ 00041 // $Date: 02/11/07 23:41:58-00:00 $ 00042 // $Author: fchow@keyresearch.com $ 00043 // $Source: /scratch/mee/2.4-65/kpro64-pending/be/region/SCCS/s.rbi.h $ 00044 // 00045 // Revision history: 00046 // 7-SEP-95 dahl - Original Version 00047 // 00048 // Description: 00049 // Region Boundary Info (RBI) 00050 // 00051 //====================================================================== 00052 //====================================================================== 00053 00054 #ifndef rbi_INCLUDED 00055 #define rbi_INCLUDED "rbi.h" 00056 #ifdef _KEEP_RCS_ID 00057 static char *rbircs_id = rbi_INCLUDED"$ $Revision: 1.2 $"; 00058 #endif /* _KEEP_RCS_ID */ 00059 00060 #include "region_util.h" 00061 00062 const INT32 WN_PROP_USED_IN = 0x01, 00063 WN_PROP_DEF_IN = 0x02, 00064 WN_PROP_LIVE_OUT = 0x04; 00065 00066 class RBI { 00067 00068 private: 00069 INT32 _trace_level; // -ttTP_REGION(41), -ttRGN 00070 MEM_POOL *_pool; 00071 WN_MAP _prop_map; 00072 WN_MAP _tag_map; // WN map, mark nodes with region id 00073 00074 public: 00075 RBI(MEM_POOL *); // pool must be supplied to constructor 00076 ~RBI(void); 00077 00078 // 0 - no trace 00079 // 1 - major function trace only (TT_REGION_RBI_DEBUG and other debug bits) 00080 // 2 - detailed trace (only RBI bit set TT_REGION_RBI_DEBUG) 00081 BOOL Trace( void ) const { return _trace_level > 0; } 00082 BOOL Trace2( void ) const { return _trace_level == 2; } 00083 00084 MEM_POOL *Mem_Pool( void ) { return _pool; } 00085 00086 void RBI_Calc_Kids(RID *root, const DU_MANAGER *du_mgr, 00087 const ALIAS_MANAGER *am); 00088 00089 void RBI_Calc_Rgn(RID *const rid_node, const DU_MANAGER *const du_mgr, 00090 const ALIAS_MANAGER *const am); 00091 00092 INT32 Rgn_WN_Tag( WN *const wn ) const 00093 { 00094 return WN_MAP32_Get( _tag_map, wn ); 00095 } 00096 00097 void Set_WN_Cur_Rgn( WN* wn, INT32 rgn_id ) 00098 { 00099 WN_MAP32_Set( _tag_map, wn, rgn_id ); 00100 } 00101 00102 BOOL Outside_Cur_Rgn( WN* wn, INT32 rgn_id ) const 00103 { 00104 // RETURNs are always considered to lie outside since they 00105 // amount to exits from the region and anything that could be 00106 // used by the exited-to code is found on the RETURN's 00107 // def-list. 00108 if (WN_opcode(wn) == OPC_RETURN) 00109 return TRUE; 00110 else 00111 return (Rgn_WN_Tag(wn) != rgn_id); 00112 } 00113 00114 INT32 Get_WN_Prop( WN *const wn ) const 00115 { 00116 return WN_MAP32_Get( _prop_map, wn ); 00117 } 00118 00119 void Set_WN_Prop( WN *const, const INT32 ); 00120 00121 void Set_PT_SET_All_Aliasable(POINTS_TO_SET *); 00122 00123 void Add_To_PT_SET(POINTS_TO_SET *, POINTS_TO *); 00124 00125 }; // end of class RBI 00126 00127 extern "C" void Region_Bound_Info(WN *tree, 00128 DU_MANAGER *du_mgr, 00129 ALIAS_MANAGER *am); 00130 00131 #endif /* ifdef rbi_INCLUDED */
1.5.6