| 1 |
/* { dg-do compile { target { aarch64*-*-* } } } */ |
| 2 |
/* { dg-additional-options "-march=armv8.2-a+sve -fdump-tree-ifcvt -Ofast" { target { aarch64*-*-* } } } */ |
| 3 |
|
| 4 |
extern int __attribute__ ((simd, const)) fn (float); |
| 5 |
|
| 6 |
const int N = 20; |
| 7 |
const float lim = 101.0; |
| 8 |
const float cst = -1.0; |
| 9 |
float tot = 0.0; |
| 10 |
|
| 11 |
float b[20]; |
| 12 |
float a[20] = { [0 ... 9] = 1.7014118e39, /* If branch. */ |
| 13 |
[10 ... 19] = 100.0 }; /* Else branch. */ |
| 14 |
|
| 15 |
int main (void) |
| 16 |
{ |
| 17 |
#pragma omp simd |
| 18 |
for (int i = 0; i < N; i += 1) |
| 19 |
{ |
| 20 |
if (a[i] > lim) |
| 21 |
b[i] = cst; |
| 22 |
else |
| 23 |
b[i] = fn (a[i]); |
| 24 |
tot += b[i]; |
| 25 |
} |
| 26 |
return (0); |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-final { scan-tree-dump {(_\d+) = (_\d+) > 1.01e\+2;\n\s*(_\d+) = ~\1;\n\s*_\d+ = .MASK_CALL \(fn, \2, \3\);} ifcvt } } */ |