implemented optimization of accesses to polymorphic fields
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 9 Mar 2005 16:17:52 +0000 (16:17 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 9 Mar 2005 16:17:52 +0000 (16:17 +0000)
[r5326]

ir/ir/Makefile.in
ir/ir/iropt.c
ir/ir/iropt_dbg.h

index 695c8e6..96703d5 100644 (file)
@@ -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
 
index 3e2e4f0..6261b30 100644 (file)
@@ -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.
index 9fa3028..5d81fd0 100644 (file)
  * 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. */
     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_ */