Visual Studio IDE / Disable vectorization

Visual Studio IDE / Disable vectorization


I wonder why there is no option in the Visual Studio integration to disable automatic vectorization ? (I know i can put the flag manually but it make a little bit tedious transition between Microsoft and Intel toolset).

Best regards

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

As far as I know, the options ICL uses to control vectorization are similar to those in CL, even though ICL is more aggressive.  You could set options such as /Qvec- in the additional command line, or set /O1, or /fp:source to cut out some optimizations which CL never undertakes.  ICL /fp:source is roughly equivalent to CL /fp:fast, and CL defaults to /fp:precise while ICL defaults to its more aggressive /fp:fast.

/Qvec- is Intel specific

/fp impacts much more than vectorization (i didn't even know it was related to automatic vectorization, i'm not talking about using SSE instruction in a scalar manner instead of FPU).

/Qvec- is documented in my copy of Microsoft C++ (not even a current one).  No doubt, it was copied over from Intel just a few years ago.  In my tests, CL does vectorize about 40% of the cases which ICL can vectorize effectively at the most aggressive settings.  If your question was about not enabling optimizations which weren't performed by some past version of CL, neither Microsoft nor Intel has additional specific options that I know of. 

ICL has /Qvc options for compatibility with specific versions of Visual Studio, but they don't control vectorization.  They used to be set as defaults at the time you install with integration into the corresponding VS.

If you use OpenMP, in my experience CL never vectorizes inside a parallel region, but I wasn't guessing you were talking about that.  ICL would still vectorize for loops properly nested inside a parallel for.

/fp: options other than fast prevent vectorization which depends on optimizing order of operations and may cause small numerical differences (usually improved accuracy).  Microsoft doesn't perform such optimizations even at /fp:fast.  ICL /fp:fast throws out the rules about order of evaluation, including observance of parentheses, replacing them with K&R style rules from prior to C89.

By FPU, you may mean the use of x87 instructions, which by default have effect similar to /fp:double.  With either CL or ICL, you would require that option to minimize differences between what ICL calls /arch:IA32 (Microsoft 32-bit default) and the SSE modes.  This option also would reduce the differences between CL and ICL, including those related to vectorization.

Can I have the link on MSDN avout /Qvec- flag because I can't find it (i use 2008 and 2010 and 2012).

Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/Qvec-'
cl : Command line error D8003 : missing source filename

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/Qvec-'
cl : Command line error D8003 : missing source filename

That does'nt explain why in the Intel C++ property sheet or the Visual Studio Integration component, there is no way to disable /Qvec- which seems to me a pretty much Intel specific compiler option (at least for people like me using prehistorical versions of Visual Studio).

Although you can always add any additional options to the "Additional command line options" in the project property, it might be better to add the "/Qvec-" to the "Diagnostics" property page. I'll file a feature request for it.

I didn't see "cl" support this option "/Qvec-" as well. "cl" does support /Qvec-report[x].



Downloadimage/png diags-vec.png21.4 KB

Thank you very much Jennifer, maybe it should be in Optimization or Code Generation, but it's your team choice. ;)


Leave a Comment

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