Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/backprop-6.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-backprop-details" } */
3 /* { dg-additional-options "-msse -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
4
5 void start (void *);
6 void end (void *);
7
8 /* Test that we optimize the contents of infinite loops. */
9 #define TEST_FUNCTION(TYPE, SUFFIX) \
10 void \
11 test##SUFFIX (TYPE *array, TYPE y, int n) \
12 { \
13 for (;;) \
14 { \
15 start (array); \
16 TYPE x = -__builtin_fabs##SUFFIX (array[-1]); \
17 for (int i = 0; i < n; ++i) \
18 x = -x / array[i]; \
19 array[-1] = x * x; \
20 array[-2] = __builtin_fma##SUFFIX (x, x, y); \
21 array[-3] = __builtin_pow##SUFFIX (x, 20); \
22 end (array); \
23 } \
24 }
25
26 TEST_FUNCTION (float, f)
27 TEST_FUNCTION (double, )
28 TEST_FUNCTION (long double, l)
29
30 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -} 4 "backprop" { target { ifn_copysign && { ! { s390*-*-* } } } } } } */
31 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = \.COPYSIGN} 2 "backprop" { target { ifn_copysign && { ! { s390*-*-* } } } } } } */
32 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = ABS_EXPR <} 1 "backprop" { target { ifn_copysign && { ! { s390*-*-* } } } } } } */
33 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = \.COPYSIGN} 3 "backprop" { target { ifn_copysign && s390*-*-* } } } } */
34 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = -} 6 "backprop" { target { ! ifn_copysign } } } } */
35 /* { dg-final { scan-tree-dump-times {Deleting[^\n]* = ABS_EXPR <} 3 "backprop" { target { ! ifn_copysign } } } } */