00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef cg_region_INCLUDED
00037 #define cg_region_INCLUDED
00038
00039 #include "bb.h"
00040 #include "tn.h"
00041 #include "tn_list.h"
00042
00043 class WN;
00044
00045 typedef struct cgrin {
00046 BB *first_bb;
00047 BB *last_bb;
00048 BB_NUM min_bb_id;
00049 TN **PREG_to_TN_mapping;
00050 TN_NUM first_regular_tn;
00051 INT32 first_gtn;
00052 BB *entry;
00053 BB **exits;
00054
00055
00056 LABEL_IDX *exit_labels;
00057 TN_LIST *tns_in;
00058 TN_LIST **tns_out;
00059 WN *entry_glue;
00060 WN **exit_glue;
00061 WN *nested_exit;
00062 } CGRIN;
00063
00064
00065 #define CGRIN_first_bb(c) ((c)->first_bb)
00066 #define CGRIN_last_bb(c) ((c)->last_bb)
00067 #define CGRIN_min_bb_id(c) ((c)->min_bb_id)
00068 #define CGRIN_preg_to_tn(c,i) (((c)->PREG_to_TN_mapping)[(i)])
00069 #define CGRIN_preg_to_tn_mapping(c) ((c)->PREG_to_TN_mapping)
00070 #define CGRIN_first_regular_tn(c) ((c)->first_regular_tn)
00071 #define CGRIN_first_gtn(c) ((c)->first_gtn)
00072 #define CGRIN_entry(c) ((c)->entry)
00073 #define CGRIN_exits(c) ((c)->exits)
00074 #define CGRIN_exit_i(c,i) (((c)->exits)[(i)])
00075 #define CGRIN_exit_labels(c) ((c)->exit_labels)
00076 #define CGRIN_exit_label_i(c,i) (((c)->exit_labels)[(i)])
00077 #define CGRIN_tns_in(c) ((c)->tns_in)
00078 #define CGRIN_tns_out(c) ((c)->tns_out)
00079 #define CGRIN_tns_out_i(c,i) (((c)->tns_out)[(i)])
00080 #define CGRIN_entry_glue(c) ((c)->entry_glue)
00081 #define CGRIN_exit_glue(c) ((c)->exit_glue)
00082 #define CGRIN_exit_glue_i(c,i) (((c)->exit_glue)[(i)])
00083 #define CGRIN_nested_exit(c) ((c)->nested_exit)
00084
00085 extern BOOL Trace_REGION_Interface;
00086
00087
00088
00089
00090
00091
00092 extern CGRIN *CGRIN_Create( INT );
00093
00094
00095
00096
00097 extern void REGION_Entry_PREG_Whirl( RID *, WN *, TN_LIST *,
00098 struct ALIAS_MANAGER * );
00099
00100
00101
00102
00103
00104
00105
00106
00107 extern LABEL_IDX REGION_Exit_Whirl_Labels( WN *exit_whirl, BB *exit_bb,
00108 LABEL_IDX external_label, RID *rid );
00109
00110
00111
00112
00113 extern void REGION_Exit_PREG_Whirl( RID *, INT, WN *, TN_LIST *,
00114 struct ALIAS_MANAGER * );
00115
00116
00117
00118
00119 inline BOOL BB_REGION_Entry( BB *bb, RID *rid )
00120 {
00121 return (rid != NULL
00122 && RID_cginfo(rid) != NULL
00123 && CGRIN_entry(RID_cginfo(rid)) == bb);
00124 }
00125
00126 #define NO_REGION_EXIT -1
00127
00128
00129
00130
00131 extern INT BB_REGION_Exit( BB *bb, RID *rid );
00132
00133
00134
00135
00136 extern void TN_LIST_Print( TN_LIST *tnl );
00137
00138
00139
00140
00141
00142 extern CGRIN* RID_Find_Cginfo( BB* );
00143
00144
00145
00146
00147
00148
00149 extern RID* Non_Transparent_RID (RID *);
00150
00151
00152 extern TN_LIST * REGION_Get_TN_In_List (RID *rid);
00153 extern TN_LIST * REGION_Get_TN_Out_List (RID *rid, INT exit_num);
00154
00155 #endif