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_ALGSIM0(oldn, n) \
70 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_ALGSIM); \
71 __dbg_info_merge_pair(n, oldn, dbg_algebraic_simplification); \
74 #define DBG_OPT_ALGSIM1(oldn, a, b, n) \
80 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
81 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
84 #define DBG_OPT_ALGSIM2(oldn, pred, n) \
90 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
91 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
94 #define DBG_OPT_ALGSIM3(oldn, a, n) \
99 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ALGSIM); \
100 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
103 #define DBG_OPT_PHI(oldn, first_val, n) \
107 ons[1] = first_val; \
108 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_PHI); \
109 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_ssa); \
114 * Merge the debug info due to Write-after-Write optimization:
115 * Store oldst will be replace by a reference to Store st
117 #define DBG_OPT_WAW(oldst, st) \
122 hook_merge_nodes(&st, 1, ons, SIZ(ons), HOOK_OPT_WAW); \
123 __dbg_info_merge_sets(&st, 1, ons, SIZ(ons), dbg_write_after_write); \
127 * Merge the debug info due to Write-after-Read optimization:
128 * store will be replace by a reference to load
130 #define DBG_OPT_WAR(store, load) \
135 hook_merge_nodes(&load, 1, ons, SIZ(ons), HOOK_OPT_WAR); \
136 __dbg_info_merge_sets(&load, 1, ons, SIZ(ons), dbg_write_after_read); \
140 * Merge the debug info due to Read-after-Write optimization:
141 * load will be replace by a reference to store
143 #define DBG_OPT_RAW(store, load) \
148 hook_merge_nodes(&store, 1, ons, SIZ(ons), HOOK_OPT_RAW); \
149 __dbg_info_merge_sets(&store, 1, ons, SIZ(ons), dbg_read_after_write); \
153 * Merge the debug info due to Read-after-Read optimization:
154 * Load oldld will be replace by a reference to Load ld
156 #define DBG_OPT_RAR(oldld, ld) \
161 hook_merge_nodes(&ld, 1, ons, SIZ(ons), HOOK_OPT_RAR); \
162 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_after_read); \
166 * Merge the debug info due to Read-a-Const optimization:
167 * Load ld will be replace by a Constant
169 #define DBG_OPT_RC(ld, c) \
174 hook_merge_nodes(&c, 1, ons, SIZ(ons), HOOK_OPT_RC); \
175 __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_a_const); \
178 #define DBG_OPT_TUPLE(oldn, a, n) \
184 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_TUPLE); \
185 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
188 #define DBG_OPT_ID(oldn, n) \
193 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ID); \
194 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
198 * Merge the debug info due to ommon-subexpression elimination
200 #define DBG_OPT_CSE(oldn, n) \
205 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_CSE); \
206 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_cse); \
209 #define DBG_OPT_POLY_ALLOC(oldn, n) \
213 ons[1] = skip_Proj(get_Sel_ptr(oldn)); \
215 hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_POLY_CALL); \
216 __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_rem_poly_call); \
219 #define DBG_OPT_POLY(oldn, n) \
221 hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_POLY_CALL); \
222 __dbg_info_merge_pair(n, oldn, dbg_rem_poly_call); \