I am using Visual Studio 2010 as my IDE with Intel Composer integrated into it. This allows me to compile using the Intel C compiler.
My objective is to compare performance when running using /O2 optimization with vectorization enabled and /O2 optimization with vectorization disabled.
To achieve the latter configuration I have set my optimization level to /O2 and added /Qvec- to the command line of all the projects in my application. The build log confirms this.
However, the assembly files of the compiled code still contain references to xmm registers in most places (I'm assuming this is because SIMD vectorization is still happening). I've cleaned and rebuiilt a few times and I'm pretty sure this is fresh assembly code.
There is hardly any change in performance when compared to the configuration where I had not included /Qvec- in the command line, so I'm pretty sure it's vectorizing pretty much everywhere, just as before.
Is there anything else I need to check/ enable/ disable to make sure vectorization does not occur. Please note that I would still like it to do an O2 level of optimization, just without vectorizing my code.
This is an vectorized case:-
.B1.2:: ; Preds .B1.2 .B1.9
movdqa XMMWORD PTR [32+rsp+rdx*4], xmm0 ;7.6
movdqa XMMWORD PTR [432+rsp+rdx*4], xmm0 ;7.1
add rdx, 4 ;6.1
paddd xmm0, xmm1 ;7.1
cmp rdx, 100 ;6.1