This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix 64-bit vectorization
- From: Ira Rosen <IRAR at il dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 2 Jan 2005 11:00:09 +0200
- Subject: Re: fix 64-bit vectorization
Richard Henderson <rth@redhat.com> wrote on 02/01/2005 10:38:42:
> Seems this is affecting quite a few 64-bit targets, causing most
> of the vectorization tests to crash. I'm not sure if we didn't
> expect to see conversions here, or if it was thought that the
> STRIP_NOPS should take care of all of them, but this seems to do
> the trick for the moment.
Indeed, I thought STRIP_NOPS should take care of the conversions.
> Index: tree-vectorizer.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
> retrieving revision 2.55
> diff -c -p -d -r2.55 tree-vectorizer.c
> *** tree-vectorizer.c 29 Dec 2004 13:54:29 -0000 2.55
> --- tree-vectorizer.c 2 Jan 2005 08:34:11 -0000
> *************** vect_analyze_offset_expr (tree expr,
> *** 1390,1396 ****
> enum tree_code code;
> tree init, evolution, def_stmt;
>
> ! STRIP_NOPS (expr);
>
> *step = NULL_TREE;
> *misalign = NULL_TREE;
> --- 1390,1411 ----
> enum tree_code code;
> tree init, evolution, def_stmt;
>
> ! /* Strip conversions that don't narrow the mode. */
> ! while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) ==
CONVERT_EXPR)
> ! {
> ! tree to, ti;
> !
> ! to = TREE_TYPE (expr);
> ! oprnd0 = TREE_OPERAND (expr, 0);
> ! ti = TREE_TYPE (oprnd0);
> !
> ! if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
> ! return false;
> ! if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE
(ti)))
> ! return false;
> !
> ! expr = oprnd0;
> ! }
>
> *step = NULL_TREE;
> *misalign = NULL_TREE;
This doesn't fix the problem with vect-65.c, since the problem there is
with LEFT_OFFSET and not with EXPR.
The following fixes the problem for ppc-darwin:
*************** vect_analyze_offset_expr (tree expr,
*** 1468,1473 ****
--- 1483,1489 ----
FORNOW: We don't support such cases. */
return false;
+ STRIP_NOPS (left_offset);
/* Misalignment computation. */
if (SSA_VAR_P (left_offset))
{
But maybe we need your fix here as well?
Thanks,
Ira