2 // { dg-options "-O2 -fdump-tree-ivopts-details" }
12 for ( int i = 0; i < 3; ++i )
16 inline const double& operator[] ( int I ) const {
28 explicit MinimalVector ( int length ) {
29 _pData = new double[length];
30 for (int i = 0; i < length; ++i) _pData[i] = 0.;
33 inline double& operator[] ( int I ) {
37 inline const double& operator[] ( int I ) const {
43 int main ( int , char** ) {
48 MinimalVec3 * rows[9];
49 for ( int i = 0; i < 9; ++i ) {
50 rows[i] = new MinimalVec3[wcub];
53 MinimalVector img ( wcub ), res ( wcub );
55 for ( int c = 0; c < 1000; ++c ) {
57 for ( int i = 1; i < w-1; ++i )
58 for ( int j = 0; j < 3; ++j ) {
60 for ( int k = 1; k < w - 1; ++k )
61 for ( int l = 0; l < 3; ++l ) {
63 for ( int m = 1; m < w - 1; ++m )
64 for ( int n = 0; n < 3; ++n )
65 res[i*wsqr + k*w + m] += img[( i + j - 1 ) *wsqr + ( k + l - 1 ) *w + m + n - 1] * rows[j*3 + l][i*wsqr + k*w + m][n];
73 // Verify that on x86_64 and i?86 we unroll the innsermost loop and
74 // use three IVs for the then innermost loop
76 // { dg-final { scan-tree-dump "Selected IV set for loop \[0-9\]* at \[^ \]*:63, 127 avg niters, 3 IVs" "ivopts" { target x86_64-*-* i?86-*-* } } }
77 // { dg-final { scan-tree-dump-not "Selected IV set for loop \[0-9\]* at \[^ \]*:64" "ivopts" { target x86_64-*-* i?86-*-* } } }