Which optimizations are applied in O1?

Which optimizations are applied in O1?

On Xeon Phi coprocessor, I have obtained 5x speedup when the following code is compiled with O1 instead of O0, for a single thread.

int i;

for( i = 0; i < nrows; i++){
        int j;
        double y0 = 0.0;
        int kstart = rows[i];
        int kend = rows[i+1];
        for( j = kstart; j < kend; j++){
            int jj = cols[j];
            double x0 = x[jj];
            y0 += val[j] * x0;

         }
         y[i] = y0;

}

I wonder which optimizations triggered by O1 flag cause 5x speedup. Is there any flag of ICC to show applied optimizations as disscussed for GCC in this question.

 

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

The 5x speedup at -O1 vs -O0 is not surprising since -O0 disables virtually any optimizations while the compiler doing many optimizations at -O1. Information about  code optimization can be found here:   https://software.intel.com/en-us/node/512873

We don't really have an equivalent option to the GCC option.

Also, to see what is optimized, you can generate a optimization report  (see https://software.intel.com/en-us/node/512991), and specify an optimization phase (see https://software.intel.com/en-us/node/512994).  

Leave a Comment

Please sign in to add a comment. Not a member? Join today