| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-rtl-ce1" } */ |
| 3 |
|
| 4 |
void sink2(int, int); |
| 5 |
void sink3(int, int, int); |
| 6 |
|
| 7 |
void cond1(int cond, int x, int y) |
| 8 |
{ |
| 9 |
if (cond) |
| 10 |
{ |
| 11 |
x = x << 4; |
| 12 |
y = 1; |
| 13 |
} |
| 14 |
|
| 15 |
sink2(x, y); |
| 16 |
} |
| 17 |
|
| 18 |
void cond2(int cond, int x, int y) |
| 19 |
{ |
| 20 |
if (cond) |
| 21 |
{ |
| 22 |
x++; |
| 23 |
y++; |
| 24 |
} |
| 25 |
|
| 26 |
sink2(x, y); |
| 27 |
} |
| 28 |
|
| 29 |
void cond3(int cond, int x1, int x2, int x3) |
| 30 |
{ |
| 31 |
if (cond) |
| 32 |
{ |
| 33 |
x1++; |
| 34 |
x2++; |
| 35 |
x3++; |
| 36 |
} |
| 37 |
|
| 38 |
sink3(x1, x2, x3); |
| 39 |
} |
| 40 |
|
| 41 |
void cond4(int cond, int x, int y) |
| 42 |
{ |
| 43 |
if (cond) |
| 44 |
{ |
| 45 |
x += 2; |
| 46 |
y += 3; |
| 47 |
} |
| 48 |
|
| 49 |
sink2(x, y); |
| 50 |
} |
| 51 |
|
| 52 |
void cond5(int cond, int x, int y, int r1, int r2) |
| 53 |
{ |
| 54 |
if (cond) |
| 55 |
{ |
| 56 |
x = r1 + 2; |
| 57 |
y = r2 - 34; |
| 58 |
} |
| 59 |
|
| 60 |
sink2(x, y); |
| 61 |
} |
| 62 |
|
| 63 |
void cond6(int cond, int x, int y) |
| 64 |
{ |
| 65 |
if (cond) |
| 66 |
{ |
| 67 |
x = -x; |
| 68 |
y = ~y; |
| 69 |
} |
| 70 |
|
| 71 |
sink2(x, y); |
| 72 |
} |
| 73 |
|
| 74 |
/* { dg-final { scan-assembler-times "cinc\t" 5 } } */ |
| 75 |
/* { dg-final { scan-assembler-times "csneg\t" 1 } } */ |
| 76 |
/* { dg-final { scan-assembler-times "csinv\t" 1 } } */ |
| 77 |
/* { dg-final { scan-assembler "csel\t" } } */ |
| 78 |
|
| 79 |
/* { dg-final { scan-rtl-dump-times "if-conversion succeeded through noce_convert_multiple_sets" 6 "ce1" } } */ |