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] Minor readability improvement in vect_pattern_recog{,_1}


On 6 October 2011 18:19, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> tree-vectorizer.h already has typedefs for the recog functions,
> and using that typedef we can make these two functions slightly more
> readable.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

Thanks,
Ira

>
> 2011-10-06 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?* tree-vect-patterns.c (vect_pattern_recog_1): Use
> ? ? ? ?vect_recog_func_ptr typedef for the first argument.
> ? ? ? ?(vect_pattern_recog): Rename vect_recog_func_ptr variable
> ? ? ? ?to vect_recog_func, use vect_recog_func_ptr typedef for it.
>
> --- gcc/tree-vect-patterns.c.jj 2011-10-06 14:37:12.000000000 +0200
> +++ gcc/tree-vect-patterns.c ? ?2011-10-06 15:50:12.000000000 +0200
> @@ -1393,10 +1393,9 @@ vect_mark_pattern_stmts (gimple orig_stm
> ? ?for vect_recog_pattern. ?*/
>
> ?static void
> -vect_pattern_recog_1 (
> - ? ? ? gimple (* vect_recog_func) (VEC (gimple, heap) **, tree *, tree *),
> - ? ? ? gimple_stmt_iterator si,
> - ? ? ? VEC (gimple, heap) **stmts_to_replace)
> +vect_pattern_recog_1 (vect_recog_func_ptr vect_recog_func,
> + ? ? ? ? ? ? ? ? ? ? gimple_stmt_iterator si,
> + ? ? ? ? ? ? ? ? ? ? VEC (gimple, heap) **stmts_to_replace)
> ?{
> ? gimple stmt = gsi_stmt (si), pattern_stmt;
> ? stmt_vec_info stmt_info;
> @@ -1580,7 +1579,7 @@ vect_pattern_recog (loop_vec_info loop_v
> ? unsigned int nbbs = loop->num_nodes;
> ? gimple_stmt_iterator si;
> ? unsigned int i, j;
> - ?gimple (* vect_recog_func_ptr) (VEC (gimple, heap) **, tree *, tree *);
> + ?vect_recog_func_ptr vect_recog_func;
> ? VEC (gimple, heap) *stmts_to_replace = VEC_alloc (gimple, heap, 1);
>
> ? if (vect_print_dump_info (REPORT_DETAILS))
> @@ -1596,8 +1595,8 @@ vect_pattern_recog (loop_vec_info loop_v
> ? ? ? ? ? /* Scan over all generic vect_recog_xxx_pattern functions. ?*/
> ? ? ? ? ? for (j = 0; j < NUM_PATTERNS; j++)
> ? ? ? ? ? ? {
> - ? ? ? ? ? ? ?vect_recog_func_ptr = vect_vect_recog_func_ptrs[j];
> - ? ? ? ? ? ? vect_pattern_recog_1 (vect_recog_func_ptr, si,
> + ? ? ? ? ? ? vect_recog_func = vect_vect_recog_func_ptrs[j];
> + ? ? ? ? ? ? vect_pattern_recog_1 (vect_recog_func, si,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?&stmts_to_replace);
> ? ? ? ? ? ? }
> ? ? ? ? }
>
> ? ? ? ?Jakub
>


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