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 2/3] Incorporate aggregate jump functions into inlining analysis


> *************** inline_merge_summary (struct cgraph_edge
> *** 2639,2655 ****
>         int count = ipa_get_cs_argument_count (args);
>         int i;
>   
> !       evaluate_properties_for_edge (edge, true, &clause, NULL, NULL);
>         if (count)
> ! 	VEC_safe_grow_cleared (int, heap, operand_map, count);
>         for (i = 0; i < count; i++)
>   	{
>   	  struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
>   	  int map = -1;
>   	  /* TODO: handle non-NOPs when merging.  */
> ! 	  if (jfunc->type == IPA_JF_PASS_THROUGH
> ! 	      && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
> ! 	    map = ipa_get_jf_pass_through_formal_id (jfunc);
>   	  VEC_replace (int, operand_map, i, map);
>   	  gcc_assert (map < ipa_get_param_count (IPA_NODE_REF (to)));
>   	}
> --- 2788,2822 ----
>         int count = ipa_get_cs_argument_count (args);
>         int i;
>   
> !       evaluate_properties_for_edge (edge, true, &clause, NULL, NULL, NULL);
>         if (count)
> ! 	{
> ! 	  VEC_safe_grow_cleared (int, heap, operand_map, count);
> ! 	  VEC_safe_grow_cleared (int, heap, offset_map, count);
> ! 	}
>         for (i = 0; i < count; i++)
>   	{
>   	  struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
>   	  int map = -1;
> + 
>   	  /* TODO: handle non-NOPs when merging.  */
> ! 	  if (jfunc->type == IPA_JF_PASS_THROUGH)
> ! 	    {
> ! 	      if (ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
> ! 		map = ipa_get_jf_pass_through_formal_id (jfunc);
> ! 	      if (!ipa_get_jf_pass_through_agg_preserved (jfunc))
> ! 		VEC_replace (int, offset_map, i, -1);
> ! 	    }
> ! 	  else if (jfunc->type == IPA_JF_ANCESTOR)
> ! 	    {
> ! 	      HOST_WIDE_INT offset = ipa_get_jf_ancestor_offset (jfunc);
> ! 	      if (offset >= 0 && offset < INT_MAX)
> ! 		{
> ! 		  map = ipa_get_jf_ancestor_formal_id (jfunc);
> ! 		  if (!ipa_get_jf_ancestor_agg_preserved (jfunc))
> ! 		    offset = -1;
> ! 		}
Missing VEC_replace (int, offset_map, i, offset) here?
So we do not handle cases where operand is unpacked from aggregate and so on.
But it seems you are missing some matching of the aggregate flags here.

Honza


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