X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt_dbg.h;h=07828796cb28f431f439a15b0f46ad5cc75df7e5;hb=e5bab593a4048c0a320d7794fb2cb17697da8389;hp=87473b1ba68c464faab72f4d13dadc85792db423;hpb=66f846a2a301d938700fee41d0e1bccc7c6d6935;p=libfirm diff --git a/ir/ir/iropt_dbg.h b/ir/ir/iropt_dbg.h index 87473b1ba..07828796c 100644 --- a/ir/ir/iropt_dbg.h +++ b/ir/ir/iropt_dbg.h @@ -1,89 +1,151 @@ +/* + * Project: libFIRM + * File name: ir/ir/iropt_dbg.h + * Purpose: Debug makros used in iropt. + * Author: Goetz Lindenmaier + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 2001-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ /* This file contains makros that generate the calls to update the debug information after a transformation. */ +#define SIZ(x) sizeof(x)/sizeof((x)[0]) + + +/** + * Merge the debug info due to dead code elimination + */ +#define DBG_OPT_DEAD \ + do { \ + ir_node *ons[2]; \ + ons[0] = oldn; \ + ons[1] = get_Block_cfgpred(oldn, 0); \ + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_STG); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_dead_code); \ + } while(0) + + +/** + * Merge the debug info due to a straightening optimization + */ #define DBG_OPT_STG \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = get_Block_cfgpred(oldn, 0); \ - __dbg_info_merge_sets(&n, 1, ons, 2, dbg_straightening); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_STG); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_straightening); \ + } while(0) +/** + * Merge the debug info due to an if simplification + */ #define DBG_OPT_IFSIM \ - { \ + do { \ ir_node *ons[4]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = b; \ ons[3] = get_Proj_pred(a); \ - __dbg_info_merge_sets(&n, 1, ons, 4, dbg_if_simplification); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_IFSIM); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_if_simplification); \ + } while(0) + +/** + * Merge the debug info due to an algebraic_simplification + */ +#define DBG_OPT_ALGSIM0 \ + do { \ + stat_merge_nodes(&n, 1, &oldn, 1, STAT_OPT_CONST_EVAL); \ + __dbg_info_merge_pair(n, oldn, dbg_const_eval); \ + } while(0) #define DBG_OPT_ALGSIM1 \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = b; \ - __dbg_info_merge_sets(&n, 1, ons, 3, dbg_algebraic_simplification); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_ALGSIM); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \ + } while(0) #define DBG_OPT_ALGSIM2 \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ - ons[1] = get_unop_op(n); \ - ons[2] = n; \ - __dbg_info_merge_sets(&n, 1, ons, 3, dbg_algebraic_simplification); \ - } + ons[1] = get_unop_op(oldn); \ + ons[2] = n; \ + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_ALGSIM); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \ + } while(0) #define DBG_OPT_ALGSIM3 \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = a; \ - __dbg_info_merge_sets(&n, 1, ons, 2, dbg_algebraic_simplification); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_ALGSIM); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \ + } while(0) #define DBG_OPT_PHI \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = first_val; \ - __dbg_info_merge_sets(&n, 1, ons, 2, dbg_opt_ssa); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_PHI); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_ssa); \ + } while(0) #define DBG_OPT_WAW \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = n; \ - __dbg_info_merge_sets(&n, 1, ons, 2, dbg_write_after_write);\ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_WAW); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_write_after_write);\ + } while(0) #define DBG_OPT_WAR \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = c; \ - __dbg_info_merge_sets(&c, 1, ons, 2, dbg_write_after_read); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_WAR); \ + __dbg_info_merge_sets(&c, 1, ons, SIZ(ons), dbg_write_after_read); \ + } while(0) + +#define DBG_OPT_RAW \ + do { \ + ir_node *ons[2]; \ + ons[0] = oldn; \ + ons[1] = c; \ + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_RAW); \ + __dbg_info_merge_sets(&c, 1, ons, SIZ(ons), dbg_read_after_write); \ + } while(0) #define DBG_OPT_TUPLE \ - { \ + do { \ ir_node *ons[3]; \ ons[0] = oldn; \ ons[1] = a; \ ons[2] = n; \ - __dbg_info_merge_sets(&n, 1, ons, 3, dbg_opt_auxnode); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_TUPLE); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \ + } while(0) + #define DBG_OPT_ID \ - { \ + do { \ ir_node *ons[2]; \ ons[0] = oldn; \ ons[1] = n; \ - __dbg_info_merge_sets(&n, 1, ons, 2, dbg_opt_auxnode); \ - } + stat_merge_nodes(&n, 1, ons, SIZ(ons), STAT_OPT_ID); \ + __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \ + } while(0)