fold-vec-ld-misc.c: New.

[gcc/testsuite]

2017-09-19  Will Schmidt  <will_schmidt@vnet.ibm.com>

        * gcc.target/powerpc/fold-vec-ld-misc.c: New.

From-SVN: r252974
This commit is contained in:
Will Schmidt 2017-09-19 13:32:54 +00:00 committed by Will Schmidt
parent 109bb9107b
commit 81b29ad80a
2 changed files with 58 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2017-09-19 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-ld-misc.c: New.
2017-09-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/82244

View File

@ -0,0 +1,54 @@
/* Verify that overloaded built-ins for vec_ld with
structure pointer / double inputs produce the right code. */
/* This test is to ensure that when a cast is associated with arg1 on a
call to vec_ld (arg0, arg1), that the arg1 type is properly handled
through the gimple folding code.
We want something like this:
D.2736 = MEM[(voidD.44 *)D.2739];
We specifically do not want 'struct S' showing up:
D.3212 = MEM[(struct S *)D.3215];
*/
/* { dg-do compile { target lp64 } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx -O2 -fdump-tree-gimple" } */
#include <altivec.h>
#include <stdio.h>
struct S {
vector int *i1,*i2;
vector long long *ll1;
vector double *vd1;
vector double *vd2;
vector double *vd3;
vector double *vd4;
};
vector double
testld_struct1 (long long ll1, struct S *p)
{
return __builtin_altivec_lvx_v2df (ll1, (double *)p);
}
vector double
testld_struct1b (long long ll1, struct S *p)
{
return vec_ld (ll1, (vector double *)p);
}
vector double
testld_struct2 (struct S *p)
{
return vec_ld (16, (vector double *)p);
}
vector double
testld_struct3 (struct S *p)
{
return vec_ld (16, (vector double *)p->vd2);
}
// We do not want the "struct S" reference to show up.
/* { dg-final { scan-tree-dump-times "MEM\[\(struct S *\)D.\[0-9\]+\]" 0 "gimple" } } */