| 1 |
/* Disabling epilogues until we find a better way to deal with scans. */ |
| 2 |
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
/* { dg-additional-options "-fno-ipa-icf" } */ |
| 5 |
/* { dg-additional-options "-mlasx" { target loongarch*-*-*} } */ |
| 6 |
|
| 7 |
#include "tree-vect.h" |
| 8 |
|
| 9 |
#define N 32 |
| 10 |
|
| 11 |
__attribute__ ((noinline)) void |
| 12 |
foo (int *__restrict a, |
| 13 |
short *__restrict b, |
| 14 |
int n) |
| 15 |
{ |
| 16 |
int i; |
| 17 |
|
| 18 |
for (i = 0; i < n; i++) |
| 19 |
a[i] = b[i] * 2333; |
| 20 |
|
| 21 |
#pragma GCC novector |
| 22 |
for (i = 0; i < n; i++) |
| 23 |
if (a[i] != b[i] * 2333) |
| 24 |
abort (); |
| 25 |
} |
| 26 |
|
| 27 |
__attribute__ ((noinline)) void |
| 28 |
bar (int *__restrict a, |
| 29 |
short *__restrict b, |
| 30 |
int n) |
| 31 |
{ |
| 32 |
int i; |
| 33 |
|
| 34 |
for (i = 0; i < n; i++) |
| 35 |
a[i] = b[i] * (short) 2333; |
| 36 |
|
| 37 |
#pragma GCC novector |
| 38 |
for (i = 0; i < n; i++) |
| 39 |
if (a[i] != b[i] * (short) 2333) |
| 40 |
abort (); |
| 41 |
} |
| 42 |
|
| 43 |
int main (void) |
| 44 |
{ |
| 45 |
int i; |
| 46 |
int a[N]; |
| 47 |
short b[N]; |
| 48 |
|
| 49 |
check_vect (); |
| 50 |
|
| 51 |
for (i = 0; i < N; i++) |
| 52 |
{ |
| 53 |
a[i] = 0; |
| 54 |
b[i] = i; |
| 55 |
__asm__ volatile (""); |
| 56 |
} |
| 57 |
|
| 58 |
foo (a, b, N); |
| 59 |
bar (a, b, N); |
| 60 |
return 0; |
| 61 |
} |
| 62 |
|
| 63 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */ |
| 64 |
/* { dg-final { scan-tree-dump-times {vect_recog_widen_mult_pattern: detected:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */ |
| 65 |
/* { dg-final { scan-tree-dump-times {widen_mult pattern recognized:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */ |
| 66 |
|