Paolo Bonzini - [PATCH 1/5]: Use pointer_map in ivopts (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The interesting thing here is that the value can be NULL; for this reason we cannot use *pointer_map_insert(map, key) being NULL as a test that KEY was not in MAP. So in the pointer_map case we must always check first for the presence of the value, and then insert it if it was absent.In addition to this, since there is no pointer_map_delete, a separate pointer_map is created for every loop.Bootstrapped C/C++/Ada/Java (Fortran is broken) on i686-pc-linux-gnu, ok for mainline?Paolo

2006-02-06 Paolo Bonzini bonzini@gnu.org

* Makefile.in (tree-ssa-loop-ivopts.o): Add pointer-set.h dependency.
* tree-ssa-loop-ivopts.c: Include pointer-set.h.
(struct ivopts_data): Change niters to pointer_map_t.
(struct nfe_cache_elt, nfe_hash, nfe_eq): Delete.
(niter_for_exit): Create pointer_map on demand.  Change for
pointer_map API.
(tree_ssa_iv_optimize_init): Initialize data->niters to NULL.
(free_loop_data): Destroy data->niters if created and reset field.
(tree_ssa_iv_optimize_finalize): Don't delete data->niters here.
(tree_ssa_iv_optimize_loop): Check for presence of stale data.

Index: Makefile.in

--- Makefile.in (revision 121601) +++ Makefile.in (working copy) @@ -2140,7 +2140,7 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-i output.h (DIAGNOSTICH)(DIAGNOSTIC_H) (DIAGNOSTICH)(TIMEVAR_H) (TMH)coretypes.h(TM_H) coretypes.h (TMH)coretypes.h(TREE_DUMP_H)
tree-pass.h (GGCH)(GGC_H) (GGCH)(RECOG_H) insn-config.h (HASHTABH)(HASHTAB_H) (HASHTABH)(SCEV_H)
(CFGLOOPH)(CFGLOOP_H) (CFGLOOPH)(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h
- tree-chrec.h $(VARRAY_H) tree-affine.h + tree-chrec.h $(VARRAY_H) tree-affine.h pointer-set.h tree-affine.o : tree-affine.c tree-affine.h $(CONFIG_H)
(SYSTEMH)(SYSTEM_H) (SYSTEMH)(RTL_H) (TREEH)(TREE_H) (TREEH)(TM_P_H)
output.h (DIAGNOSTICH)(DIAGNOSTIC_H) (DIAGNOSTICH)(TM_H) coretypes.h $(TREE_DUMP_H) Index: tree-ssa-loop-ivopts.c

--- tree-ssa-loop-ivopts.c (revision 121601) +++ tree-ssa-loop-ivopts.c (working copy) @@ -83,6 +83,7 @@ Software Foundation, 51 Franklin Street, #include "ggc.h" #include "insn-config.h" #include "recog.h" +#include "pointer-set.h" #include "hashtab.h" #include "tree-chrec.h" #include "tree-scalar-evolution.h" @@ -208,7 +209,7 @@ struct ivopts_data unsigned regs_used; /* Numbers of iterations for all exits of the current loop. */ - htab_t niters; + struct pointer_map_t niters; / The size of version_info array allocated. / unsigned version_info_size; @@ -673,58 +674,26 @@ contains_abnormal_ssa_name_p (tree expr) return false; } -/ Element of the table in that we cache the numbers of iterations obtained - from exits of the loop. */

-struct nfe_cache_elt -{ - /* The edge for that the number of iterations is cached. */ - edge exit;

/* Returns tree describing number of iterations determined from @@ -770,7 +741,7 @@ tree_ssa_iv_optimize_init (struct ivopts data->relevant = BITMAP_ALLOC (NULL); data->important_candidates = BITMAP_ALLOC (NULL); data->max_inv_id = 0;

EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi) { @@ -5304,7 +5279,6 @@ tree_ssa_iv_optimize_finalize (struct iv free (data->version_info); BITMAP_FREE (data->relevant); BITMAP_FREE (data->important_candidates);

@@ -5320,6 +5294,7 @@ tree_ssa_iv_optimize_loop (struct ivopts struct iv_ca *iv_ca; edge exit;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]