[PATCH][TUPLES] Tuplifying tree-vectorize.c

Doug Kwan (關振德) dougkwan@google.com
Tue Jun 24 16:54:00 GMT 2008


Diego

2008/6/24 Diego Novillo <dnovillo@google.com>:

> Needs corresponding changes in Makefile.in

Yes, I also noticed that after I submitted the patch.
>
>set_phi_nodes (new_merge_bb, phi_reverse (phi_nodes (new_merge_bb)));
>> }
>
> Where are we setting the PHI nodes on NEW_MERGE_BB now?

Good one. I was going to remove the phi_reverse call but I ended up
removing the whole thing by mistake.

>
>> - if (node && CAN_HAVE_LOCATION_P (node) && EXPR_HAS_LOCATION (node)
>> - && EXPR_FILENAME (node) && EXPR_LINENO (node))
>> - return EXPR_LOC (node);
>> + /* FIXME tuples. The original code check for both location
>> + and file name. */
>> + if (stmt && gimple_location (stmt) != UNKNOWN_LOC)
>> + return gimple_location (stmt);
>
> No need for the FIXME note.  Your test is the correct one.
>
>> +static hashval_t
>> +hash_gimple_stmt (const void *p)
>> +{
>> + return (hashval_t) p;
>> +}
>> +
>> +static int
>> +eq_gimple_stmt (const void *p1, const void *p2)
>> +{
>> + return p1 == p2;
>> +}
>> +
>> +void
>> +init_stmt_vec_info_htab (void)
>> +{
>> + gcc_assert (!stmt_vec_info_htab);
>> + stmt_vec_info_htab = htab_create (10, hash_gimple_stmt, eq_gimple_stmt,
>> + NULL);
>> +}
>> +
>> +void
>> +free_stmt_vec_info_htab (void)
>> +{
>> + gcc_assert (stmt_vec_info_htab);
>> + htab_delete (stmt_vec_info_htab);
>> + stmt_vec_info_htab = NULL;
>> +}
>
> Need comment on all these (even if it is just one comment for all of them).
>
>> +/* Error reporting helper for vect_is_simple_reduction below. */
>> +static void
>> +report_vect_op (gimple stmt, const char *msg)
>
> Blank linke after comment.  Need to document STMT and MSG.
>
>> + switch (get_gimple_rhs_class (code))
>> + {
>> + case GIMPLE_SINGLE_RHS:
>> + operation = gimple_assign_rhs1 (stmt);
>> + break;
>> + case GIMPLE_UNARY_RHS:
>> + operation = build1 (code, TREE_TYPE (gimple_assign_lhs (stmt)),
>> + gimple_assign_rhs1 (stmt));
>
> I don't like this.  Building an expression tree just to display it is too
> wasteful.  Better use print_gimple_stmt here, or just print the operands
> separately (maybe by factoring code in gimple-pretty-print.c).

My original intention was to preserve the output so to avoid
mismatches in tests.  These messages are normally not printed.  I can
change that.


> The rest looks fine.

Thanks.

-Doug



More information about the Gcc-patches mailing list