3 * File name: ir/ir/iropt_dbg.h
4 * Purpose: Debug makros used in iropt.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2001-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 #include "dbginfo_t.h"
19 /* This file contains makros that generate the calls to
20 update the debug information after a transformation. */
22 #define SIZ(x) sizeof(x)/sizeof((x)[0])
26 * Merge the debug info due to dead code elimination
28 #define DBG_OPT_DEAD(oldn, n) \
32 ons[1] = get_Block_cfgpred(oldn, 0); \
33 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_STG); \
34 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_dead_code); \
39 * Merge the debug info due to a straightening optimization
41 #define DBG_OPT_STG(oldn, n) \
45 ons[1] = get_Block_cfgpred(oldn, 0); \
46 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_STG); \
47 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_straightening); \
51 * Merge the debug info due to an if simplification
53 #define DBG_OPT_IFSIM(oldn, a, b, n) \
59 ons[3] = get_Proj_pred(a); \
60 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_IFSIM); \
61 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_if_simplification); \
65 * Merge the debug info due to an algebraic_simplification
67 #define DBG_OPT_CSTEVAL(oldn, n) \
69 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_CONST_EVAL); \
70 __dbg_info_merge_pair(n, oldn, dbg_const_eval); \
73 #define DBG_OPT_ALGSIM0(oldn, n) \
75 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_ALGSIM); \
76 __dbg_info_merge_pair(n, oldn, dbg_algebraic_simplification); \
79 #define DBG_OPT_ALGSIM1(oldn, a, b, n) \
85 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
86 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
89 #define DBG_OPT_ALGSIM2(oldn, pred, n) \
95 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
96 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
99 #define DBG_OPT_ALGSIM3(oldn, a, n) \
104 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
105 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
108 #define DBG_OPT_PHI(oldn, first_val, n) \
112 ons[1] = first_val; \
113 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_PHI); \
114 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_ssa); \
119 * Merge the debug info due to Write-after-Write optimization:
120 * Store oldst will be replace by a reference to Store st
122 #define DBG_OPT_WAW(oldst, st) \
127 hook_merge_nodes(&st, 1, ons, SIZ(ons), HOOK_OPT_WAW); \
128 __dbg_info_merge_sets(&st, 1, ons, SIZ(ons), dbg_write_after_write); \
132 * Merge the debug info due to Write-after-Read optimization:
133 * store will be replace by a reference to load
135 #define DBG_OPT_WAR(store, load) \
140 hook_merge_nodes(&load, 1, ons, SIZ(ons), HOOK_OPT_WAR); \
141 __dbg_info_merge_sets(&load, 1, ons, SIZ(ons), dbg_write_after_read); \
145 * Merge the debug info due to Read-after-Write optimization:
146 * load will be replace by a reference to store
148 #define DBG_OPT_RAW(store, load) \
153 hook_merge_nodes(&store, 1, ons, SIZ(ons), HOOK_OPT_RAW); \
154 __dbg_info_merge_sets(&store, 1, ons, SIZ(ons), dbg_read_after_write); \
158 * Merge the debug info due to Read-after-Read optimization:
159 * Load oldld will be replace by a reference to Load ld
161 #define DBG_OPT_RAR(oldld, ld) \
166 hook_merge_nodes(&ld, 1, ons, SIZ(ons), HOOK_OPT_RAR); \
167 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_after_read); \
171 * Merge the debug info due to Read-a-Const optimization:
172 * Load ld will be replace by a Constant
174 #define DBG_OPT_RC(ld, c) \
179 hook_merge_nodes(&c, 1, ons, SIZ(ons), HOOK_OPT_RC); \
180 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_a_const); \
183 #define DBG_OPT_TUPLE(oldn, a, n) \
189 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_TUPLE); \
190 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
193 #define DBG_OPT_ID(oldn, n) \
198 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ID); \
199 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
203 * Merge the debug info due to ommon-subexpression elimination
205 #define DBG_OPT_CSE(oldn, n) \
210 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_CSE); \
211 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_cse); \
214 #define DBG_OPT_POLY_ALLOC(oldn, n) \
218 ons[1] = skip_Proj(get_Sel_ptr(oldn)); \
220 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_POLY_CALL); \
221 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_rem_poly_call); \
224 #define DBG_OPT_POLY(oldn, n) \
226 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_POLY_CALL); \
227 __dbg_info_merge_pair(n, oldn, dbg_rem_poly_call); \
230 #define DBG_OPT_CONFIRM(oldn, n) \
232 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_CONFIRM); \
235 #endif /* _IROPT_DBG_H_ */