From: Götz Lindenmaier Date: Wed, 9 Mar 2005 16:17:52 +0000 (+0000) Subject: implemented optimization of accesses to polymorphic fields X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=2f887e2dd25dd3c4c72a57214d241b925b329924;p=libfirm implemented optimization of accesses to polymorphic fields [r5326] --- diff --git a/ir/ir/Makefile.in b/ir/ir/Makefile.in index 695c8e609..96703d538 100644 --- a/ir/ir/Makefile.in +++ b/ir/ir/Makefile.in @@ -40,7 +40,8 @@ include $(topdir)/MakeRules CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \ -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \ -I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \ - -I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(topdir)/ir/config + -I$(top_srcdir)/ir/stat -I$(top_srcdir)/ir/external -I$(topdir)/ir/config \ + -I$(top_srcdir)/ir/opt include $(top_srcdir)/MakeTargets diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 3e2e4f00b..6261b306c 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6,7 +6,7 @@ * Modified by: Goetz Lindenmaier * Created: * CVS-ID: $Id$ - * Copyright: (c) 1998-2003 Universität Karlsruhe + * Copyright: (c) 1998-2005 Universität Karlsruhe * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ @@ -39,6 +39,7 @@ # include "irhooks.h" # include "irarch.h" # include "hashptr.h" +# include "opt_polymorphy.h" /* Make types visible to allow most efficient access */ # include "entity_t.h" @@ -2010,6 +2011,7 @@ static ir_op *firm_set_default_transform_node(ir_op *op) CASE(Proj); CASE(Or); CASE(End); + CASE(Sel); case iro_Shr: case iro_Shrs: case iro_Shl: @@ -2478,17 +2480,18 @@ optimize_node (ir_node *n) free the node. */ iro = get_irn_opcode(n); if (get_opt_constant_folding() || - (iro == iro_Cond) || - (iro == iro_Proj)) /* Flags tested local. */ - n = transform_node (n); + (iro == iro_Cond) || + (iro == iro_Proj) || + (iro == iro_Sel)) /* Flags tested local. */ + n = transform_node (n); /* Remove nodes with dead (Bad) input. - Run always for transformation induced Bads. */ + Run always for transformation induced Bads. */ n = gigo (n); /* Now we have a legal, useful node. Enter it in hash table for cse */ if (get_opt_cse() && (get_irn_opcode(n) != iro_Block)) { - n = identify_remember (current_ir_graph->value_table, n); + n = identify_remember (current_ir_graph->value_table, n); } return n; @@ -2565,7 +2568,8 @@ optimize_in_place_2 (ir_node *n) iro = get_irn_opcode(n); if (get_opt_constant_folding() || (iro == iro_Cond) || - (iro == iro_Proj)) /* Flags tested local. */ + (iro == iro_Proj) || + (iro == iro_Sel)) /* Flags tested local. */ n = transform_node (n); /* Remove nodes with dead (Bad) input. diff --git a/ir/ir/iropt_dbg.h b/ir/ir/iropt_dbg.h index 9fa302827..5d81fd0e3 100644 --- a/ir/ir/iropt_dbg.h +++ b/ir/ir/iropt_dbg.h @@ -10,6 +10,11 @@ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ +#ifndef _IROPT_DBG_H_ +#define _IROPT_DBG_H_ + +#include "dbginfo_t.h" +#include "irhooks.h" /* This file contains makros that generate the calls to update the debug information after a transformation. */ @@ -221,3 +226,5 @@ hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_POLY_CALL); \ __dbg_info_merge_pair(n, oldn, dbg_rem_poly_call); \ } while(0) + +#endif /* _IROPT_DBG_H_ */