Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / shrink-wrap-separate-2.c
blobb22564a51c5be3315095b2e3d18e67bd64a3782d
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler {\mmflr\M.*\mbl\M.*\mmflr\M.*\mbl\M} } } */
5 /* This tests if shrink-wrapping for separate components puts a prologue
6 inside a loop when that is useful. In this case, it saves the link
7 register before each call: both calls happen with probability .10,
8 so saving the link register happens with .80 per execution of f on
9 average, which is smaller than 1 which you would get if you saved
10 it outside the loop. */
12 int *a;
13 void g(void);
15 void f(int x)
17 int j;
18 for (j = 0; j < 4; j++) {
19 if (__builtin_expect(a[j], 0))
20 g();
21 asm("#" : : : "memory");
22 if (__builtin_expect(a[j], 0))
23 g();
24 a[j]++;