From fa4ec191e159484f0fcbea2ef044deaa2ab2d293 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 3 Apr 2006 13:44:20 +0000 Subject: [PATCH 1/1] added DBG_OPT_LEA( to report Lea craetion to the firm statistic module --- ir/be/ia32/ia32_optimize.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ir/be/ia32/ia32_optimize.c b/ir/be/ia32/ia32_optimize.c index c6e2f76b3..6a88bda3d 100644 --- a/ir/be/ia32/ia32_optimize.c +++ b/ir/be/ia32/ia32_optimize.c @@ -20,6 +20,25 @@ #include "gen_ia32_regalloc_if.h" /* the generated interface (register type and class defenitions) */ #include "ia32_transform.h" +/*----*/ + +#include "irhooks.h" +#include "dbginfo_t.h" +#include "firmstat.h" + +/** + * Merge the debug info due to a LEA creation. + * + * @param oldn the node + * @param n the new constant holding the value + */ +#define DBG_OPT_LEA(oldn, n) \ + do { \ + hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LEA); \ + __dbg_info_merge_pair(n, oldn, dbg_backend); \ + } while(0) + + #undef is_NoMem #define is_NoMem(irn) (get_irn_op(irn) == op_NoMem) @@ -885,6 +904,9 @@ static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, ir_node *noreg) { DBG((mod, LEVEL_1, "\tLEA [%+F + %+F * %d + %s]\n", base, index, scale, get_ia32_am_offs(res))); + /* we will exchange it, report here before the Proj is created */ + DBG_OPT_LEA(irn, res); + /* get the result Proj of the Add/Sub */ irn = get_res_proj(irn); -- 2.20.1