| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize -mrvv-max-lmul=dynamic -fdump-tree-vect-details" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
void |
| 7 |
foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, |
| 8 |
int32_t *__restrict a2, int32_t *__restrict b2, int32_t *__restrict c2, |
| 9 |
int32_t *__restrict a3, int32_t *__restrict b3, int32_t *__restrict c3, |
| 10 |
int32_t *__restrict a4, int32_t *__restrict b4, int32_t *__restrict c4, |
| 11 |
int32_t *__restrict a5, int32_t *__restrict b5, int32_t *__restrict c5, |
| 12 |
int32_t *__restrict d, |
| 13 |
int32_t *__restrict d2, |
| 14 |
int32_t *__restrict d3, |
| 15 |
int32_t *__restrict d4, |
| 16 |
int32_t *__restrict d5, |
| 17 |
int32_t *__restrict e, |
| 18 |
int32_t *__restrict e2, |
| 19 |
int32_t *__restrict e3, |
| 20 |
int32_t *__restrict e4, |
| 21 |
int32_t *__restrict e5, |
| 22 |
int32_t *__restrict f, |
| 23 |
int32_t *__restrict f2, |
| 24 |
int32_t *__restrict f3, |
| 25 |
int32_t *__restrict f4, |
| 26 |
int32_t *__restrict f5, |
| 27 |
int32_t *__restrict g, |
| 28 |
int32_t *__restrict g2, |
| 29 |
int32_t *__restrict g3, |
| 30 |
int32_t *__restrict g4, |
| 31 |
int32_t *__restrict g5, |
| 32 |
|
| 33 |
int32_t *__restrict gg, |
| 34 |
int32_t *__restrict gg2, |
| 35 |
int32_t *__restrict gg3, |
| 36 |
int32_t *__restrict gg4, |
| 37 |
int32_t *__restrict gg5, |
| 38 |
|
| 39 |
int32_t *__restrict ggg, |
| 40 |
int32_t *__restrict ggg2, |
| 41 |
int32_t *__restrict ggg3, |
| 42 |
int32_t *__restrict ggg4, |
| 43 |
int32_t *__restrict ggg5, |
| 44 |
|
| 45 |
int32_t *__restrict gggg, |
| 46 |
int32_t *__restrict gggg2, |
| 47 |
int32_t *__restrict gggg3, |
| 48 |
int32_t *__restrict gggg4, |
| 49 |
int32_t *__restrict gggg5, |
| 50 |
|
| 51 |
int32_t *__restrict ggggg, |
| 52 |
int32_t *__restrict ggggg2, |
| 53 |
int32_t *__restrict ggggg3, |
| 54 |
int32_t *__restrict ggggg4, |
| 55 |
int32_t *__restrict ggggg5, |
| 56 |
int n) |
| 57 |
{ |
| 58 |
for (int i = 0; i < n; i++) |
| 59 |
{ |
| 60 |
a[i] = b[i] + c[i]; |
| 61 |
b5[i] = b[i] + c[i]; |
| 62 |
a2[i] = b2[i] + c2[i]; |
| 63 |
a3[i] = b3[i] + c3[i]; |
| 64 |
a4[i] = b4[i] + c4[i]; |
| 65 |
a5[i] = a[i] + a4[i]; |
| 66 |
|
| 67 |
d2[i] = a2[i] + c2[i]; |
| 68 |
d3[i] = a3[i] + c3[i]; |
| 69 |
d4[i] = a4[i] + c4[i]; |
| 70 |
d5[i] = a[i] + a4[i]; |
| 71 |
a[i] = a5[i] + b5[i] + a[i]; |
| 72 |
|
| 73 |
c2[i] = a[i] + c[i]; |
| 74 |
c3[i] = b5[i] * a5[i]; |
| 75 |
c4[i] = a2[i] * a3[i]; |
| 76 |
c5[i] = b5[i] * a2[i]; |
| 77 |
c[i] = a[i] + c3[i]; |
| 78 |
c2[i] = a[i] + c4[i]; |
| 79 |
|
| 80 |
e[i] = c2[i] + c2[i]; |
| 81 |
e2[i] = c2[i] + d2[i]; |
| 82 |
e3[i] = d3[i] + d3[i]; |
| 83 |
e4[i] = c4[i] + a4[i]; |
| 84 |
e5[i] = a[i] + a4[i]; |
| 85 |
a5[i] = a[i] + a4[i]; |
| 86 |
|
| 87 |
f[i] = e2[i] + c2[i]; |
| 88 |
f2[i] = e2[i] + d2[i]; |
| 89 |
f3[i] = e3[i] + d3[i]; |
| 90 |
f4[i] = e4[i] + a4[i]; |
| 91 |
f5[i] = e[i] + a4[i]; |
| 92 |
f5[i] = e5[i] + a4[i]; |
| 93 |
|
| 94 |
g[i] = f2[i] + c2[i]; |
| 95 |
g2[i] = f2[i] + d2[i]; |
| 96 |
g3[i] = f3[i] + d3[i]; |
| 97 |
g4[i] = f4[i] + a4[i]; |
| 98 |
g5[i] = f[i] + a4[i]; |
| 99 |
g5[i] = f5[i] + a4[i]; |
| 100 |
|
| 101 |
|
| 102 |
gg[i] = f2[i] + c2[i]; |
| 103 |
gg2[i] = f2[i] + d2[i]; |
| 104 |
gg3[i] = f3[i] + d3[i]; |
| 105 |
gg4[i] = f4[i] + a4[i]; |
| 106 |
gg5[i] = f[i] + a4[i]; |
| 107 |
gg5[i] = f5[i] + a4[i]; |
| 108 |
|
| 109 |
|
| 110 |
ggg[i] = f2[i] + c2[i]; |
| 111 |
ggg2[i] = f2[i] + d2[i]; |
| 112 |
ggg3[i] = f3[i] + d3[i]; |
| 113 |
ggg4[i] = f4[i] + a4[i]; |
| 114 |
ggg5[i] = f[i] + a4[i]; |
| 115 |
ggg5[i] = f5[i] + a4[i]; |
| 116 |
|
| 117 |
gggg[i] = f2[i] + c2[i]; |
| 118 |
gggg2[i] = f2[i] + d2[i]; |
| 119 |
gggg3[i] = f3[i] + d3[i]; |
| 120 |
gggg4[i] = f4[i] + a4[i]; |
| 121 |
gggg5[i] = f[i] + a4[i]; |
| 122 |
gggg5[i] = f5[i] + a4[i]; |
| 123 |
|
| 124 |
ggggg[i] = f2[i] + c2[i]; |
| 125 |
ggggg2[i] = f2[i] + d2[i]; |
| 126 |
ggggg3[i] = f3[i] + d3[i]; |
| 127 |
ggggg4[i] = f4[i] + a4[i]; |
| 128 |
ggggg5[i] = f[i] + a4[i]; |
| 129 |
ggggg5[i] = f5[i] + a4[i]; |
| 130 |
|
| 131 |
a[i] = a[i] + b5[i] + a[i] * a2[i] * a3[i] * a4[i] |
| 132 |
* a5[i] * c[i] * c2[i] * c3[i] * c4[i] * c5[i] |
| 133 |
* d[i] * d2[i] * d3[i] * d4[i] * d5[i] |
| 134 |
* e[i] * e2[i] * e3[i] * e4[i] * e5[i] |
| 135 |
* f[i] * f2[i] * f3[i] * f4[i] * f5[i] |
| 136 |
* g[i] * g2[i] * g3[i] * g4[i] * g5[i] |
| 137 |
* gg[i] * gg2[i] * gg3[i] * gg4[i] * gg5[i] |
| 138 |
* ggg[i] * ggg2[i] * ggg3[i] * ggg4[i] * ggg5[i] |
| 139 |
* gggg[i] * gggg2[i] * gggg3[i] * gggg4[i] * gggg5[i] |
| 140 |
* ggggg[i] * ggggg2[i] * ggggg3[i] * ggggg4[i] * ggggg5[i]; |
| 141 |
} |
| 142 |
} |
| 143 |
|
| 144 |
/* { dg-final { scan-assembler {e32,m1} } } */ |
| 145 |
/* { dg-final { scan-assembler-not {csrr} } } */ |
| 146 |
/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */ |
| 147 |
/* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */ |
| 148 |
/* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */ |
| 149 |
/* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */ |