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] Update SSA_NAME manager to use two lists


On Wed, Sep 30, 2015 at 11:44:38AM -0600, Jeff Law wrote:
> +/* Move all SSA_NAMEs from FREE_SSA_NAMES_QUEUE to FREE_SSA_NAMES.
> +
> +   We do not, but should have a mode to verify the state of the SSA_NAMEs
> +   lists.  In particular at this point every name must be in the IL,
> +   on the free list or in the queue.  Anything else is an error.  */
> +
> +void
> +flush_ssaname_freelist (void)
> +{
> +  while (!vec_safe_is_empty (FREE_SSANAMES_QUEUE (cfun)))
> +    {
> +      tree t = FREE_SSANAMES_QUEUE (cfun)->pop ();
> +      vec_safe_push (FREE_SSANAMES (cfun), t);
> +    }

Isn't it faster to just do:
  vec_safe_splice (FREE_SSANAMES (cfun), FREE_SSANAMES_QUEUE (cfun));
  vec_safe_truncate (FREE_SSANAMES_QUEUE (cfun));
or so?  I mean, rather than reallocating the vector perhaps many times
grow it just once to the exact size, and memcpy there the data.

	Jakub


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