[PING][PR67476] Add param parloops-schedule

Bernd Schmidt bschmidt@redhat.com
Tue Sep 22 11:25:00 GMT 2015


On 09/22/2015 09:19 AM, Tom de Vries wrote:
> These two patches:
> - https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00938.html
> - https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00940.html
> add a param parloop-schedule=<static|dynamic|guided|auto|runtime>.

The problem I have when trying to review them is that the second patch 
does quite a bit more, and there's no description of these changes in 
your mail or in the comments. Please explain what the non-obvious parts 
of the patch do.

For example - this thing is entirely unexplained:
> +  if (gimple_in_ssa_p (cfun))
> +    {
> +      gphi_iterator psi;
> +
> +      for (psi = gsi_start_phis (l3_bb); !gsi_end_p (psi); gsi_next (&psi))
> +	{
> +	  source_location locus;
> +	  gphi *nphi;
> +	  gphi *exit_phi = psi.phi ();
> +
> +	  edge l2_to_l3 = find_edge (l2_bb, l3_bb);
> +	  tree exit_res = PHI_ARG_DEF_FROM_EDGE (exit_phi, l2_to_l3);
>
> +	  basic_block latch = BRANCH_EDGE (cont_bb)->dest;
> +	  edge latch_to_l1 = find_edge (latch, l1_bb);
> +	  gphi *inner_phi = find_phi_with_arg_on_edge (exit_res, latch_to_l1);
> +
> +	  tree t = gimple_phi_result (exit_phi);
> +	  tree new_res = copy_ssa_name (t, NULL);
> +	  nphi = create_phi_node (new_res, l0_bb);
> +
> +	  edge l0_to_l1 = find_edge (l0_bb, l1_bb);
> +	  t = PHI_ARG_DEF_FROM_EDGE (inner_phi, l0_to_l1);
> +	  locus = gimple_phi_arg_location_from_edge (inner_phi, l0_to_l1);
> +	  edge entry_to_l0 = find_edge (entry_bb, l0_bb);
> +	  add_phi_arg (nphi, t, entry_to_l0, locus);
> +
> +	  edge l2_to_l0 = find_edge (l2_bb, l0_bb);
> +	  add_phi_arg (nphi, exit_res, l2_to_l0, UNKNOWN_LOCATION);
> +
> +	  add_phi_arg (inner_phi, new_res, l0_to_l1, UNKNOWN_LOCATION);
> +	};
> +    }
> +

Also, it would be good to know why having this param is important. Is it 
a tool for development? Are users expected to use it?


Bernd



More information about the Gcc-patches mailing list