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 17/18] make pending_{read,write}_insns vec<rtx_insn *>


On Wed, Apr 20, 2016 at 02:22:21AM -0400, tbsaunde+gcc@tbsaunde.org wrote:
> 	(add_insn_mem_dependence): Likewise. Likewise.

Likewise!

> @@ -1614,22 +1644,22 @@ remove_from_dependence_list (rtx_insn *insn, rtx_insn_list **listp)
>  /* Same as above, but process two lists at once.  */
>  static int
>  remove_from_both_dependence_lists (rtx_insn *insn,
> -				   rtx_insn_list **listp,
> +				   vec<rtx_insn *> *insns,
>  				   rtx_expr_list **exprp)
>  {
>    int removed = 0;
>  
> -  while (*listp)
> +  unsigned int len = insns->length ();
> +  for (unsigned int i = len - 1; i < len; i--)
>      {
> -      if (XEXP (*listp, 0) == insn)
> +      if ((*insns)[i] == insn)
>          {
> -          remove_free_INSN_LIST_node (listp);
> +	  insns->ordered_remove (i);
>            remove_free_EXPR_LIST_node (exprp);
>            removed++;
>            continue;
>          }
>  
> -      listp = (rtx_insn_list **)&XEXP (*listp, 1);
>        exprp = (rtx_expr_list **)&XEXP (*exprp, 1);
>      }

Tab-ify it all, not just the line you edit?

> @@ -2489,33 +2514,29 @@ sched_analyze_1 (struct deps_desc *deps, rtx x, rtx_insn *insn)
>  	}
>        else
>  	{
> -	  rtx_insn_list *pending;
>  	  rtx_expr_list *pending_mem;
>  
> -	  pending = deps->pending_read_insns;
> +	  unsigned int len = deps->pending_read_insns.length ();
>  	  pending_mem = deps->pending_read_mems;
> -	  while (pending)
> +	  for (unsigned int i = len - 1; i < len; i--)
>  	    {
> +	      rtx_insn *temp = deps->pending_read_insns[i];
>  	      if (anti_dependence (pending_mem->element (), t)
> -		  && ! sched_insns_conditions_mutex_p (insn, pending->insn ()))
> -		note_mem_dep (t, pending_mem->element (), pending->insn (),
> -			      DEP_ANTI);
> +		  && ! sched_insns_conditions_mutex_p (insn, temp))
> +		note_mem_dep (t, pending_mem->element (), temp, DEP_ANTI);

No space after "!" (yeah, pre-existing).  More of that later in the file.


Segher


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