Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
ipa_lno_summary.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 cxx_ipa_lno_summary_INCLUDED
00037 #define cxx_ipa_lno_summary_INCLUDED
00038 
00039 #ifndef mtypes_INCLUDED
00040 #include "mtypes.h"
00041 #endif
00042 
00043 #ifndef symtab_idx_INCLUDED
00044 #include "symtab_idx.h" 
00045 #endif 
00046 
00047 class IPA_LNO_SUMMARY_PROCEDURE {
00048 private:
00049   ST_IDX _st_idx;
00050   mINT32 _formal_index;
00051   mINT32 _global_index; 
00052   mINT32 _value_index; 
00053   mINT32 _expr_index : 31; 
00054   mUINT32 _has_incomplete_array_info : 1;
00055   mUINT16 _formal_count; 
00056   mUINT16 _global_count; 
00057   mUINT16 _value_count; 
00058   mUINT16 _expr_count; 
00059 
00060 public: 
00061   IPA_LNO_SUMMARY_PROCEDURE() :
00062     _st_idx (ST_IDX_ZERO),
00063     _formal_index (-1), 
00064     _global_index (-1),
00065     _value_index (-1),
00066     _expr_index (-1),
00067     _has_incomplete_array_info (FALSE),
00068     _formal_count (0),
00069     _global_count (0),
00070     _value_count (0),
00071     _expr_count (0) 
00072   {}
00073 
00074   ST_IDX St_Idx() const { return _st_idx; }
00075   INT Formal_Index() const { return _formal_index; }
00076   INT Global_Index() const { return _global_index; }
00077   INT Value_Index() const { return _value_index; }
00078   INT Expr_Index() const { return _expr_index; }
00079   INT Formal_Count() const { return _formal_count; }
00080   INT Global_Count() const { return _global_count; }
00081   INT Value_Count() const { return _value_count; }
00082   INT Expr_Count() const { return _expr_count; }
00083   BOOL Has_Incomplete_Array_Info() const 
00084     { return _has_incomplete_array_info; }
00085   void Set_St_Idx(ST_IDX v) { _st_idx = v; }
00086   void Set_Formal_Index(INT v) { _formal_index = v; }
00087   void Set_Global_Index(INT v) { _global_index = v; }
00088   void Set_Value_Index(INT v) { _value_index = v; }
00089   void Set_Expr_Index(INT v) { _expr_index = v; }
00090   void Set_Formal_Count(INT v) { _formal_count = v; }
00091   void Set_Global_Count(INT v) { _global_count = v; }
00092   void Set_Value_Count(INT v) { _value_count = v; }
00093   void Set_Expr_Count(INT v) { _expr_count = v; }
00094   void Reset_Has_Incomplete_Array_Info() { _has_incomplete_array_info = FALSE; }
00095   void Set_Has_Incomplete_Array_Info() { _has_incomplete_array_info = TRUE; }
00096 
00097   void Print(FILE* fp, INT procedure_index = -1); 
00098 }; 
00099 
00100 class IPA_LNO_SUMMARY_FORMAL {
00101 private: 
00102 #define IPA_LNO_FORMAL_MUST_KILL        0x00000001
00103 #define IPA_LNO_FORMAL_MAY_KILL         0x00000002
00104 #define IPA_LNO_FORMAL_EXP_USE          0x00000004
00105 #define IPA_LNO_FORMAL_USE              0x00000008
00106 #define IPA_LNO_FORMAL_MUST_REDUC       0x00000010
00107 #define IPA_LNO_FORMAL_MAY_REDUC        0x00000020
00108 #define IPA_LNO_FORMAL_SCALAR           0x00000040
00109 #define IPA_LNO_FORMAL_ARRAY            0x00000080
00110 #define IPA_LNO_FORMAL_UNKNOWN          0x00000100
00111   mUINT32 _state; 
00112   mINT32 _position; 
00113   mINT32 _machine_type;
00114   mINT32 _mod_array_section_index;
00115   mINT32 _ref_array_section_index; 
00116   mINT32 _decl_array_section_index;
00117 public: 
00118   IPA_LNO_SUMMARY_FORMAL() {_state = 0; _machine_type = MTYPE_UNKNOWN; 
00119     _position = -1; _mod_array_section_index = -1; 
00120     _ref_array_section_index = -1;};
00121   INT Position() const {return _position;};
00122   INT Machine_Type() const {return _machine_type;};
00123   INT Mod_Array_Section_Index() const {return _mod_array_section_index;};
00124   INT Ref_Array_Section_Index() const {return _ref_array_section_index;};
00125   INT Decl_Array_Section_Index() const {return _decl_array_section_index;};
00126   void Clear_State() {_state = 0;};
00127   void Set_Position(INT v) {_position = v;};
00128   void Set_Machine_Type(TYPE_ID v) {_machine_type = v;};
00129   void Set_Mod_Array_Section_Index(INT v) {_mod_array_section_index = v;};
00130   void Set_Ref_Array_Section_Index(INT v) {_ref_array_section_index = v;};
00131   void Set_Decl_Array_Section_Index(INT v) {_decl_array_section_index = v;};
00132   // IPA_LNO_FORMAL_MUST_KILL
00133   BOOL Is_Must_Kill() const {return _state & IPA_LNO_FORMAL_MUST_KILL;}; 
00134   void Set_Must_Kill() {_state |= IPA_LNO_FORMAL_MUST_KILL;}; 
00135   void Reset_Must_Kill() {_state &= ~IPA_LNO_FORMAL_MUST_KILL;};
00136   // IPA_LNO_FORMAL_MAY_KILL
00137   BOOL Is_May_Kill() const {return _state & IPA_LNO_FORMAL_MAY_KILL;}; 
00138   void Set_May_Kill() {_state |= IPA_LNO_FORMAL_MAY_KILL;}; 
00139   void Reset_May_Kill() {_state &= ~IPA_LNO_FORMAL_MAY_KILL;};
00140   // IPA_LNO_FORMAL_EXP_USE
00141   BOOL Is_Exp_Use() const {return _state & IPA_LNO_FORMAL_EXP_USE;}; 
00142   void Set_Exp_Use() {_state |= IPA_LNO_FORMAL_EXP_USE;}; 
00143   void Reset_Exp_Use() {_state &= ~IPA_LNO_FORMAL_EXP_USE;};
00144   // IPA_LNO_FORMAL_USE
00145   BOOL Is_Use() const {return _state & IPA_LNO_FORMAL_USE;}; 
00146   void Set_Use() {_state |= IPA_LNO_FORMAL_USE;}; 
00147   void Reset_Use() {_state &= ~IPA_LNO_FORMAL_USE;};
00148   // IPA_LNO_FORMAL_MUST_REDUC
00149   BOOL Is_Must_Reduction() const {return _state & IPA_LNO_FORMAL_MUST_REDUC;}; 
00150   void Set_Must_Reduction() {_state |= IPA_LNO_FORMAL_MUST_REDUC;}; 
00151   void Reset_Must_Reduction() {_state &= ~IPA_LNO_FORMAL_MUST_REDUC;};
00152   // IPA_LNO_FORMAL_MAY_REDUC
00153   BOOL Is_May_Reduction() const {return _state & IPA_LNO_FORMAL_MAY_REDUC;}; 
00154   void Set_May_Reduction() {_state |= IPA_LNO_FORMAL_MAY_REDUC;}; 
00155   void Reset_May_Reduction() {_state &= ~IPA_LNO_FORMAL_MAY_REDUC;};
00156   // IPA_LNO_FORMAL_SCALAR
00157   BOOL Is_Scalar() const {return _state & IPA_LNO_FORMAL_SCALAR;}; 
00158   BOOL Is_Array() const {return _state & IPA_LNO_FORMAL_ARRAY;}; 
00159   BOOL Is_Unknown() const {return _state & IPA_LNO_FORMAL_UNKNOWN;}; 
00160   void Set_Scalar() {_state |= IPA_LNO_FORMAL_SCALAR;}; 
00161   void Set_Array() {_state |= IPA_LNO_FORMAL_ARRAY;}; 
00162   void Set_Unknown() {_state |= IPA_LNO_FORMAL_UNKNOWN;}; 
00163   void Reset_Scalar() {_state &= ~IPA_LNO_FORMAL_SCALAR;};
00164   void Reset_Array() {_state &= ~IPA_LNO_FORMAL_ARRAY;};
00165   void Reset_Unknown() {_state &= ~IPA_LNO_FORMAL_UNKNOWN;};
00166   void Print(FILE* fp, INT formal_index = -1); 
00167 };
00168 
00169 class IPA_LNO_SUMMARY_GLOBAL { 
00170 private:
00171   ST_IDX _st_idx; 
00172   mINT32 _mod_array_section_index : 31;
00173   mUINT32 _may_kill : 1;
00174   mINT32 _ref_array_section_index : 31; 
00175   mUINT32 _use : 1;
00176   
00177 public: 
00178   IPA_LNO_SUMMARY_GLOBAL (ST_IDX st_idx,
00179                           INT32 array_mod,
00180                           INT32 array_ref,
00181                           BOOL scalar_mod,
00182                           BOOL scalar_ref) :
00183     _st_idx (st_idx),
00184     _mod_array_section_index (array_mod),
00185     _may_kill (scalar_mod),
00186     _ref_array_section_index (array_ref),
00187     _use (scalar_ref) 
00188   {}
00189   
00190   ST_IDX St_Idx() const { return _st_idx; }
00191   INT Mod_Array_Section_Index() const { return _mod_array_section_index; }
00192   INT Ref_Array_Section_Index() const { return _ref_array_section_index; }
00193   BOOL Is_May_Kill() const { return _may_kill; }
00194   BOOL Is_Use() const { return _use; }
00195 
00196   void Set_St_Idx(INT v) { _st_idx = v; }
00197   void Set_Mod_Array_Section_Index(INT v) { _mod_array_section_index = v; }
00198   void Set_Ref_Array_Section_Index(INT v) { _ref_array_section_index = v; }
00199   void Set_May_Kill() { _may_kill = TRUE; }
00200   void Set_Use() { _use = TRUE; }
00201   
00202   BOOL Is_Scalar() const { return TY_kind(ST_type(_st_idx)) != KIND_ARRAY; }
00203   
00204   void Print(FILE* fp, INT common_index = -1); 
00205 };
00206 
00207 #endif // cxx_ipa_lno_summary_INCLUDED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines