This is the mail archive of the gcc-patches@gcc.gnu.org mailing 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]

Re: [patch] Fix for automatic parallelization


Hi,

> Index: tree-parloops.c
> ===================================================================
> --- tree-parloops.c	(revision 131401)
> +++ tree-parloops.c	(working copy)
> @@ -1262,7 +1262,6 @@ create_loop_fn (void)
>  static void
>  canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
>  {
> -  unsigned precision = TYPE_PRECISION (TREE_TYPE (nit));
>    tree phi, prev, res, type, var_before, val, atype, mtype, t, next;
>    block_stmt_iterator bsi;
>    bool ok;
> @@ -1270,16 +1269,7 @@ canonicalize_loop_ivs (struct loop *loop
>    edge exit = single_dom_exit (loop);
>    struct reduction_info *red;
>  
> -  for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
> -    {
> -      res = PHI_RESULT (phi);
> -
> -      if (is_gimple_reg (res) && TYPE_PRECISION (TREE_TYPE (res)) > precision)
> -	precision = TYPE_PRECISION (TREE_TYPE (res));
> -    }
> -
> -  type = lang_hooks.types.type_for_size (precision, 1);
> -
> +  type = TREE_TYPE (nit);
>    bsi = bsi_last (loop->latch);
>    create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE,
>  	     loop, &bsi, true, &var_before, NULL);

this fix looks weird, let me please have a look first what's going on
there.

> @@ -1695,6 +1685,9 @@ gen_parallel_loop (struct loop *loop, ht
>      create_call_for_reduction (loop, reduction_list, &clsn_data);
>  
>    scev_reset ();
> +  free_numbers_of_iterations_estimates_loop (parallel_head->loop_father);
> +  if (loop_outer (parallel_head->loop_father))
> +    free_numbers_of_iterations_estimates_loop (loop_outer (parallel_head->loop_father));

you need to release the estimates for all loops, not just
these two.

Zdenek


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