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] vectorizer: fix handling of non VECTOR_MODE_P vectypes


> Test case?

Sure:

Tests vect-[82,83].c below currently ICE.
If compiled in addition with -mpowerpc64 (testcases vect-[82,83]_64.c),
then they don't ICE: vect-82_64.c passes ok, and vect-83_64.c produces
wrong results.
With the patch (that disables vectorization in this case), the tests will
pass, but we lose the opportunity to vectorize vect-82_64.c (which may not
be so terrible cause we may want to convert this loop to a call to memset
instead).

dorit

=====================================
vect-82.c:
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" {
target powerpc*-*-* } } */

#include <stdarg.h>
#include "tree-vect.h"

#define N 16

int main1 ()
{
  long long unsigned int ca[N];
  int i;

  for (i = 0; i < N; i++)
    ca[i] = 0;

  /* check results:  */
  for (i = 0; i < N; i++)
    {
      if (ca[i] != 0)
        abort ();
    }

  return 0;
}

int main (void)
{
  check_vect ();
  return main1 ();
}
=====================================
vect-83.c:
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" {
target powerpc*-*-* } } */

#include <stdarg.h>
#include "tree-vect.h"

#define N 16

int main1 ()
{
  long long unsigned int ca[N];
  int i;

  for (i = 0; i < N; i++)
    ca[i] = 2;

  /* check results:  */
  for (i = 0; i < N; i++)
    {
      if (ca[i] != 2)
        abort ();
    }

  return 0;
}

int main (void)
{
  check_vect ();
  return main1 ();
}
=====================================
vect-82_64.c:
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats
-maltivec" { target powerpc*-*-* } } */

#include <stdarg.h>
#include "tree-vect.h"

#define N 16

int main1 ()
{
  long long unsigned int ca[N];
  int i;

  for (i = 0; i < N; i++)
    ca[i] = 0;

  /* check results:  */
  for (i = 0; i < N; i++)
    {
      if (ca[i] != 0)
        abort ();
    }

  return 0;
}

int main (void)
{
  check_vect ();
  return main1 ();
}
=====================================
vect-83_64.c:
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-stats
-maltivec" { target powerpc*-*-* } } */

#include <stdarg.h>
#include "tree-vect.h"

#define N 16

int main1 ()
{
  long long unsigned int ca[N];
  int i;

  for (i = 0; i < N; i++)
    ca[i] = 2;

  /* check results:  */
  for (i = 0; i < N; i++)
    {
      if (ca[i] != 2)
        abort ();
    }

  return 0;
}

int main (void)
{
  check_vect ();
  return main1 ();
}
=====================================



|---------+---------------------------->
|         |           Richard Henderson|
|         |           <rth@redhat.com> |
|         |                            |
|         |           12/10/2004 18:27 |
|---------+---------------------------->
  >----------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                            |
  |       To:       Dorit Naishlos/Haifa/IBM@IBMIL                                                                             |
  |       cc:       gcc-patches@gcc.gnu.org, mark@codesourcery.com                                                             |
  |       Subject:  Re: [patch] vectorizer: fix handling of non VECTOR_MODE_P vectypes                                         |
  >----------------------------------------------------------------------------------------------------------------------------|




On Tue, Oct 12, 2004 at 02:45:50PM +0200, Dorit Naishlos wrote:
> ... but on second thought, the current version is not restrictive
> enough - it allows initialization with constant/invariants which
> would not be handled correctly (unless it's an initialization with
> 0 or -1).

Test case?


r~




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