[PATCH] PR 40049, prevent garbage collect errors on machines with vector/vector shift

Richard Guenther richard.guenther@gmail.com
Fri May 8 12:38:00 GMT 2009


On Fri, May 8, 2009 at 2:09 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> This patch fixes PR 40049, so that the correct tree/types are used when the
> compiler is converting a vector << scalar shift into a vector << vector shift
> for the machines that only have vector << vector shift (powerpc, spu -- the
> x86_64 sse5 instruction set also has vector << vector shifts, but since they
> also have vector << scalar shifts, they won't run into the situation as much).
>
> Ultimately, this is due to vect_get_vec_def_for_operand creating the vector
> from the scalar, and the type is incorrect in the shift case.  In particular,
> shifts and rotates are unusual, in that they are binary operators, but the
> types of the left and right sides are not identical (the right side is int).
> Originally, I fixed it in vect_get_vec_df_for_operand, but it was suggested
> that it was better to fix it in a more targetted approach.  I rewrote the
> patch originally to just convert the type of operand, but in some cases, it
> fails the simple_use test if the operand is loop invariant, but not a
> constant.  So my third patch creates the constructor directly for that case.

Hm.  I do not think this is correct.  Why is vect_is_simple_use
failing for you?  I guess this is because op1 is then something
like (short) i_1?  With that you would end up generating invalid
gimple.

The vectorizer would need to insert a conversion stmt for this
(or does it end up doing that - that is, does it re-gimplify the
vectorized stmts?).

Thanks,
Richard.

> I did bootstrap/make check on both x86_64 and powerpc64-linux.  On the x86_64
> there are no regressions or improvements in the tests.  On the powerpc side,
> testcase gcc.dg/vect/ggc-pr37574.c which had regressed is now passing.  Since
> this testcase shows up the bug, I did not write up a new test case for the
> compiler.
>
> Is this patch ok to apply?
>
> --
> Michael Meissner, IBM
> 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
> meissner@linux.vnet.ibm.com
>



More information about the Gcc-patches mailing list