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
00037
00038
00039
00040
00041
00042 #ifndef wn_lower_INCLUDED
00043 #define wn_lower_INCLUDED
00044
00045 #include "opt_alias_interface.h"
00046
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050
00051
00052
00053
00054 typedef INT64 LOWER_ACTIONS;
00055
00056 #define LOWER_NULL 0x000000000000ll
00057 #define LOWER_DO_LOOP 0x000000000001ll
00058 #define LOWER_DO_WHILE 0x000000000002ll
00059 #define LOWER_WHILE_DO 0x000000000004ll
00060 #define LOWER_IF 0x000000000008ll
00061 #define LOWER_COMPLEX 0x000000000010ll
00062 #define LOWER_ARRAY 0x000000000020ll
00063 #define LOWER_SPLIT_CONST_OFFSETS 0x000000000040ll
00064 #define LOWER_ENTRY_EXIT 0x000000000080ll
00065 #define LOWER_CALL 0x000000000100ll
00066 #define LOWER_SPLIT_SYM_ADDRS 0x000000000200ll
00067 #define LOWER_IO_STATEMENT 0x000000000400ll
00068 #define LOWER_MSTORE 0x000000000800ll
00069 #define LOWER_CVT 0x000000001000ll
00070 #define LOWER_MP 0x000000002000ll
00071 #define LOWER_8X_ARRAY 0x000000004000ll
00072 #define LOWER_REGION 0x000000008000ll
00073 #define LOWER_QUAD 0x000000010000ll
00074 #define LOWER_COMPGOTO 0x000000020000ll
00075 #define LOWER_MADD 0x000000040000ll
00076 #define LOWER_INTRINSIC 0x000000080000ll
00077 #define LOWER_INLINE_INTRINSIC 0x000000100000ll
00078 #define LOWER_TOP_LEVEL_ONLY 0x000000200000ll
00079 #define LOWER_REGION_EXITS 0x000000400000ll
00080 #define LOWER_INL_STACK_INTRINSIC 0x000000800000ll
00081 #define LOWER_PREFETCH_MAPS 0x000001000000ll
00082 #define LOWER_ALIAS_MAPS 0x000002000000ll
00083 #define LOWER_DEPGRAPH_MAPS 0x000004000000ll
00084 #define LOWER_PARITY_MAPS 0x000008000000ll
00085 #define LOWER_PICCALL 0x000010000000ll
00086 #define LOWER_BASE_INDEX 0x000020000000ll
00087 #define LOWER_ASSERT 0x000040000000ll
00088 #define LOWER_FREQUENCY_MAPS 0x000080000000ll
00089 #define LOWER_FORMAL_REF 0x000100000000ll
00090 #define LOWER_UPLEVEL 0x000200000000ll
00091 #define LOWER_ENTRY_FORMAL_REF 0x000400000000ll
00092 #define LOWER_SHORTCIRCUIT 0x000800000000ll
00093 #define LOWER_TREEHEIGHT 0x001000000000ll
00094 #define LOWER_RETURN_VAL 0x002000000000ll
00095 #define LOWER_MLDID_MSTID 0x004000000000ll
00096 #define LOWER_BIT_FIELD_ID 0x008000000000ll
00097 #define LOWER_BITS_OP 0x010000000000ll
00098 #if defined(TARG_IA32) || defined(TARG_X8664)
00099 #define LOWER_SLINK_SAVE 0x020000000000ll
00100 #endif
00101 #define LOWER_TO_MEMLIB 0x040000000000ll
00102 #define LOWER_FAST_EXP 0x080000000000ll
00103 #define LOWER_EARLY_MLOAD 0x100000000000ll
00104 #define LOWER_TO_CG 0x800000000000ll
00105 #if defined(TARG_SL)
00106 #define LOWER_FP_EMULATE 0x400000000000ll
00107 #endif
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 #define LOWER_SCF (LOWER_DO_LOOP | LOWER_DO_WHILE | LOWER_WHILE_DO | LOWER_IF)
00127
00128 #define LOWER_ALL_MAPS (LOWER_PREFETCH_MAPS | LOWER_ALIAS_MAPS | LOWER_DEPGRAPH_MAPS | LOWER_PARITY_MAPS | LOWER_FREQUENCY_MAPS)
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 typedef enum
00139 {
00140 PARITY_UNKNOWN= ~0x0,
00141 PARITY_COMPLEX_REAL= 0x01,
00142 PARITY_COMPLEX_IMAG= 0x02,
00143 PARITY_QUAD_HI= 0x04,
00144 PARITY_QUAD_LO= 0x08
00145 } PARITY;
00146
00147
00148
00149 extern PARITY WN_parity(WN *tree);
00150
00151
00152 extern BOOL WN_parity_independent(WN *wn1, WN *wn2);
00153
00154
00155
00156
00157 extern void Lower_Init(void);
00158 extern void Lowering_Finalize(void);
00159
00160 extern FLD_HANDLE FLD_And_Offset_From_Field_Id (TY_IDX struct_ty_idx,
00161 UINT field_id,
00162 UINT& cur_field_id,
00163 UINT64& offset);
00164
00165 extern WN *WN_Lower(WN *tree, LOWER_ACTIONS actions, struct ALIAS_MANAGER *alias, const char *msg);
00166
00167
00168
00169
00170 extern WN *lower_scf_non_recursive(WN *block, WN *tree, LOWER_ACTIONS actions);
00171
00172
00173
00174
00175 extern WN *lower_block(WN *tree, LOWER_ACTIONS actions);
00176
00177
00178
00179
00180 extern const char *LOWER_ACTIONS_name(LOWER_ACTIONS action);
00181
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185
00186
00187
00188
00189 extern UINT32 compute_offset_alignment(INT32 offset, UINT32 align);
00190
00191
00192
00193
00194 extern TY *compute_alignment_type(WN *tree, TY *type, INT64 offset);
00195
00196
00197
00198
00199 extern void WN_Lower_Checkdump(const char *msg, WN *tree, LOWER_ACTIONS actions);
00200
00201
00202
00203
00204 extern void U64_lower_wn(WN *, BOOL);
00205
00206 #ifdef KEY
00207 extern void WN_retype_expr(WN *);
00208 extern WN* Transform_To_Memcpy(WN *dst, WN *src, INT32 offset, TY_IDX dstTY, TY_IDX srcTY, WN *size);
00209 #endif
00210
00211 #endif