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.
14 /* This file contains makros that generate the calls to
15 update the debug information after a transformation. */
17 #define SIZ(x) sizeof(x)/sizeof((x)[0])
21 * Merge the debug info due to dead code elimination
23 #define DBG_OPT_DEAD(oldn, n) \
27 ons[1] = get_Block_cfgpred(oldn, 0); \
28 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_STG); \
29 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_dead_code); \
34 * Merge the debug info due to a straightening optimization
36 #define DBG_OPT_STG(oldn, n) \
40 ons[1] = get_Block_cfgpred(oldn, 0); \
41 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_STG); \
42 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_straightening); \
46 * Merge the debug info due to an if simplification
48 #define DBG_OPT_IFSIM(oldn, a, b, n) \
54 ons[3] = get_Proj_pred(a); \
55 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_IFSIM); \
56 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_if_simplification); \
60 * Merge the debug info due to an algebraic_simplification
62 #define DBG_OPT_CSTEVAL(oldn, n) \
64 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_CONST_EVAL); \
65 __dbg_info_merge_pair(n, oldn, dbg_const_eval); \
68 #define DBG_OPT_ALGSIM1(oldn, a, b, n) \
74 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
75 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
78 #define DBG_OPT_ALGSIM2(oldn, pred, n) \
84 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
85 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
88 #define DBG_OPT_ALGSIM3(oldn, a, n) \
93 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
94 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
97 #define DBG_OPT_PHI(oldn, first_val, n) \
101 ons[1] = first_val; \
102 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_PHI); \
103 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_ssa); \
108 * Merge the debug info due to Write-after-Write optimization:
109 * Store oldst will be replace by a reference to Store st
111 #define DBG_OPT_WAW(oldst, st) \
116 hook_merge_nodes(&st, 1, ons, SIZ(ons), HOOK_OPT_WAW); \
117 __dbg_info_merge_sets(&st, 1, ons, SIZ(ons), dbg_write_after_write); \
121 * Merge the debug info due to Write-after-Read optimization:
122 * store will be replace by a reference to load
124 #define DBG_OPT_WAR(store, load) \
129 hook_merge_nodes(&load, 1, ons, SIZ(ons), HOOK_OPT_WAR); \
130 __dbg_info_merge_sets(&load, 1, ons, SIZ(ons), dbg_write_after_read); \
134 * Merge the debug info due to Read-after-Write optimization:
135 * load will be replace by a reference to store
137 #define DBG_OPT_RAW(store, load) \
142 hook_merge_nodes(&store, 1, ons, SIZ(ons), HOOK_OPT_RAW); \
143 __dbg_info_merge_sets(&store, 1, ons, SIZ(ons), dbg_read_after_write); \
147 * Merge the debug info due to Read-after-Read optimization:
148 * Load oldld will be replace by a reference to Load ld
150 #define DBG_OPT_RAR(oldld, ld) \
155 hook_merge_nodes(&ld, 1, ons, SIZ(ons), HOOK_OPT_RAR); \
156 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_after_read); \
160 * Merge the debug info due to Read-a-Const optimization:
161 * Load ld will be replace by a Constant
163 #define DBG_OPT_RC(ld, c) \
168 hook_merge_nodes(&c, 1, ons, SIZ(ons), HOOK_OPT_RC); \
169 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_a_const); \
172 #define DBG_OPT_TUPLE(oldn, a, n) \
178 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_TUPLE); \
179 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
182 #define DBG_OPT_ID(oldn, n) \
187 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ID); \
188 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
192 * Merge the debug info due to ommon-subexpression elimination
194 #define DBG_OPT_CSE(oldn, n) \
199 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_CSE); \
200 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_cse); \
203 #define DBG_OPT_POLY_ALLOC(oldn, n) \
207 ons[1] = skip_Proj(get_Sel_ptr(oldn)); \
209 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_POLY_CALL); \
210 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_rem_poly_call); \
213 #define DBG_OPT_POLY(oldn, n) \
215 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_POLY_CALL); \
216 __dbg_info_merge_pair(n, oldn, dbg_rem_poly_call); \