cfgexpand: Expand comment on when non-var clobbers can show up
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-const-u16.c
blobe9db8285b664a4a455f55bab805d8779c23defac
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*-*-*} } */
7 #include "tree-vect.h"
9 #define N 32
11 __attribute__ ((noinline)) void
12 foo (unsigned int *__restrict a,
13 unsigned short *__restrict b,
14 int n)
16 int i;
18 for (i = 0; i < n; i++)
19 a[i] = b[i] * 2333;
21 #pragma GCC novector
22 for (i = 0; i < n; i++)
23 if (a[i] != b[i] * 2333)
24 abort ();
27 __attribute__ ((noinline)) void
28 bar (unsigned int *__restrict a,
29 unsigned short *__restrict b,
30 int n)
32 int i;
34 for (i = 0; i < n; i++)
35 a[i] = (unsigned short) 2333 * b[i];
37 #pragma GCC novector
38 for (i = 0; i < n; i++)
39 if (a[i] != b[i] * (unsigned short) 2333)
40 abort ();
43 __attribute__ ((noinline)) void
44 baz (unsigned int *__restrict a,
45 unsigned short *__restrict b,
46 int n)
48 int i;
50 for (i = 0; i < n; i++)
51 a[i] = b[i] * 233333333;
53 #pragma GCC novector
54 for (i = 0; i < n; i++)
55 if (a[i] != b[i] * 233333333)
56 abort ();
60 int main (void)
62 int i;
63 unsigned int a[N];
64 unsigned short b[N];
66 check_vect ();
68 for (i = 0; i < N; i++)
70 a[i] = 0;
71 b[i] = i;
72 __asm__ volatile ("");
75 foo (a, b, N);
76 bar (a, b, N);
77 baz (a, b, N);
78 return 0;
81 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target vect_widen_mult_hi_to_si } } } */
82 /* { dg-final { scan-tree-dump-times {vect_recog_widen_mult_pattern: detected:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
83 /* { dg-final { scan-tree-dump-times {widen_mult pattern recognized:[^\n]* = \(int\)} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */