| Option |
Architecture |
Description |
Default |
| Windows* |
Linux* |
| /fast |
-fast |
i64 |
Enhances speed across the entire program.
Linux: Enables -O3 -ipo -static
Windows: Enables /O3 /Qipo
|
OFF |
i32,
i32em |
Enhances speed across the entire program.
Linux: Enables -ipo, -O3, -no-prec-div, -static,
and -xP
Windows: /O3, /Qipo, /Qprec-div-,
and /QxP
On IA-32 and Intel® EM64T systems, the -xP (Linux) or /QxP (Windows) option that is set by the fast option cannot be overridden
by other command line options. If you specify the fast option and
a different processor-specific option, such as -xN (Linux) or /QxN (Windows), the compiler will issue a warning that explains the
-xP or /QxP option cannot be overridden. |
| /G1 |
-tpp1 |
i64 |
Target optimization to the Itanium processor. |
OFF |
| /G2 |
-tpp2 |
i64 |
Target optimization to the ItaniumŪ 2 processor. Generated
code is compatible with the Itanium processor. |
ON |
| /O1 |
-O1 |
all |
Enables optimizations for speed and disables some optimizations
that increase code size and affect speed.
To limit code size, this option:
- Enables global optimization; this includes data-flow analysis,
code motion, strength reduction and test replacement, split-lifetime
analysis, and instruction scheduling.
- On Itanium®-based systems, it disables
software pipelining, loop unrolling, and global code scheduling.
- On IA-32 systems, it disables intrinsic recognition and intrinsics
inlining.
On Intel® Itanium® processors, this option also enables
optimizations for server applications (straight-line and
branch-like code with a flat profile).
The O1 option may improve performance for applications with very
large code size, many branches, and execution time not dominated
by code within loops. |
OFF |
| /O2 |
-O2 |
all |
Enables optimizations for speed. This is the generally recommended
optimization level.
On Itanium-based systems, this option enables optimizations for
speed, including global code scheduling, software pipelining, predication,
and speculation. It also enables:
- Inlining of intrinsics
- Intra-file interprocedural optimizations, which include:
- inlining
- constant propagation
- forward substitution
- routine attribute propagation
- variable address-taken analysis
- dead static function elimination
- removal of unreferenced variables
- The following capabilities for performance gain:
- constant propagation
- copy propagation
- dead-code elimination
global register allocation
- global instruction scheduling and control speculation
- loop unrolling
- optimized code selection
- partial redundancy elimination
- strength reduction/induction
variable simplification
- variable renaming
- exception handling optimizations
- tail recursions
- peephole optimizations
- structure assignment lowering and optimizations
- dead store elimination
On Linux systems, this option is the same as the O option; on Linux
IA-32 systems, this option is also the same as the O1 option.
|
ON |
| /O3 |
-O3 |
all |
Enables O2 optimizations plus more aggressive optimizations,
such as prefetching, scalar replacement, and loop and memory access
transformations. Enables optimizations for maximum speed, such
as:
- Loop unrolling, including instruction scheduling
- Code replication to eliminate branches
- Padding the size of certain power-of-two arrays to allow more
efficient cache use.
The O3 option also does the following:
- On IA-32 processors, when the O3 option is used
with options -ax or -x (Linux) or with options /Qax or /Qx (Windows),
it causes
the compiler to perform more aggressive data dependency
analysis than
for O2, which may result in longer compilation times.
- On Intel Itanium processors, the O3 option enables optimizations
for technical computing applications (loop-intensive
code):
loop optimizations and data prefetch.
On Linux systems, the O3 option sets the -fp
option.
See the documentation for more information. |
OFF |
| /Od |
None |
all |
This option disables all optimizations. It can be used for
selective optimizations, such as a combination of /Od and /Og (disables
all global optimizations), or /Od and /Ob1 (disables all optimizations,
but enables inlining).
|
OFF |
| /Oi[-] |
-f[no-]builtin |
all |
This option enables inline expansion of intrinsic
functions.
Oi- (Windows) and fno-builtin (Linux) disable inline expansion
of intrinsic functions. |
OFF |
| /Op[-] |
-mp |
all |
This option enables conformance to the ANSI C and IEEE 754
standards for floating-point arithmetic.
It restricts some optimizations to maintain declared precision
and to ensure that floating-point arithmetic conforms more closely
to the ANSI and IEEE standards. Floating point intermediate results
are kept in full 10-byte internal precision. All spills and reloads
of the x87 floating-point registers utilize this internal format
to prevent accidental loss of precision.
Very precise; slows your application down. |
OFF |
| /Qax{K|W|N|B|P} |
-ax{K|W|N|B|P} |
i32,
i32em |
Generates specialized code for processor-specific codes K,
W, N, B, and P while also generating generic IA-32 code.
- K = Intel Pentium III and compatible Intel processors.
- W = Intel Pentium 4 and compatible Intel processors.
- N = Intel Pentium 4 and compatible Intel processors.
- B = Intel Pentium M and compatible Intel processors.
- P = Intel Pentium 4 processors with Streaming SIMD Extensions
3 (SSE3).
On Intel® EM64T systems, W and P are the only valid processor
values. |
OFF |
| /Qip |
-ip |
all |
This option enables more interprocedural optimizations for
single file compilation.
It enables the compiler to perform inline function expansion for
calls to functions defined within the current source file.
Full intra-file interprocedural optimizations are not enabled.
|
OFF |
| /Qipo[n] |
-ipo[n] |
all |
This option enables interprocedural optimizations between files.
This is also called multifile interprocedural optimization (multifile
IPO) or Whole Program Optimization (WPO).
When you specify this option, the compiler performs inline function
expansion for calls to functions defined in separate files.
You cannot specify the names for the files that are created.
If n is 0, the compiler decides whether to create one or more
object files based on an estimate of the size of the application.
It generates one object file for small applications, and two or
more object files for large applications.
If n is greater than 0, the compiler generates n object files,
unless n exceeds the number of source files (m), in which case
the compiler generates only m object files.
If you do not specify n, the default
is 0.
|
OFF |
| /Qlong_double |
None |
i32,
i32em |
Changes the default size of the long double
type from 64 to 80 bits.
|
OFF |
| /Qopenmp |
-openmp |
all |
This option enables the parallelizer to generate multi-threaded
code based on the OpenMP* directives. The code can be executed
in parallel on both uniprocessor and multiprocessor systems.
This option works with the option specifying no optimization (-O0 on Linux; /Od on Windows) and any optimization level of option
O. Specifying -O0 with -openmp (Linux) or /Od with /Qopenmp (Windows)
helps to debug OpenMP applications.
|
OFF |
| /Qpc{32|64|80} |
-pc{32|64|80} |
i32,
i32em |
This option enables control of floating-point significand
precision.
Some floating-point algorithms are sensitive to the accuracy of
the significand, or fractional part of the floating-point value.
For example, iterative operations like division and finding the
square root can run faster if you lower the precision with
this option.
Note that a change of the default precision control or rounding
mode, for example, by using the -pc32 (Linux) or /Qpc32 (Windows)
option or by user intervention, may affect the results returned
by some of the mathematical functions.
|
Windows:
/Qpc64
Linux:
-pc64 |
| /Qprec |
-mp1 |
i32 |
This option improves floating-point consistency. It ensures
the out-of-range check of operands of transcendental functions
and improves the accuracy of floating-point compares.
This option prevents the compiler from performing optimizations
that change NaN comparison semantics and causes all values to be
truncated to declared precision before they are used in comparisons.
It also causes the compiler to use library routines that give better
precision results compared to the X87 transcendental instructions.
It has less impact on performance than the /Op option. |
OFF |
| /Qprec_div[-] |
-[no-]prec_div |
i32,
i32em |
This option improves precision of floating-point divides.
It has a slight impact on speed.
With some optimizations, such as -xN and -xB, the compiler may
change floating-point division computations into multiplication
by the reciprocal of the denominator. For example, A/B is computed
as A * (1/B) to improve the speed of the computation. However,
for values of B greater than 2126, the value of 1/B is "flushed" (changed)
to 0.
When it is important to maintain the value of 1/B, use this option
to disable the floating-point division-to-multiplication optimization.
The result is more accurate, with some loss of performance.
If you specify -no-prec-div (Linux) or /Qprec-div- (Windows),
it enables optimizations that give slightly less precise results
than full IEEE division.
|
OFF |
| /Qprof_dir dir |
-prof_dir dir |
all |
This option specifies a directory for profiling information
output files (*.dyn and *.dpi). The specified directory must already
exist.
You should specify this option using the same directory name for
both instrumentation and feedback compilations. If you move the
.dyn files, you need to specify the new path.
|
OFF |
| /Qprof-genx |
-prof-genx |
all |
This option instruments a program for profiling and gathers
extra information (source position) for code coverage tools.
Like -prof-gen (Linux) or /Qprof-gen (Windows), it is used in
phase 1 of the Profile Guided Optimizer (PGO) to instruct the compiler
to produce instrumented code in your object files in preparation
for instrumented execution. It also creates a new static profile
information file (.spi).
If you do not use a code coverage tool, this option may slow parallel
compile times.
Parallel make is automatically supported for compilations that
use this option.
|
OFF |
| /Qprof_use |
-prof_use |
|
This option enables the use of profiling information (including
function splitting and function grouping) during optimization.
This option instructs the compiler to produce a profile-optimized
executable and it merges available profiling output files into
a pgopti.dpi file.
Note that there is no way to turn off function grouping if you
enable it using this option.
|
OFF |
| /Qrcd |
-rcd |
i32 |
This option enables fast float-to-integer conversions. It
can improve the performance of code that requires floating-point-to-integer
conversions.
Can cause incorrect results for programs (esp. Fortran)
that depend on rounding.
|
OFF |
| /Qx{K|W|N|B|P} |
-x{K|W|N|B|P} |
i32,
i32em |
Generates specialized code for processor-specific codes K,
W, N, B, and P.
- K = Intel Pentium III and compatible Intel processors.
- W = Intel Pentium 4 and compatible Intel processors.
- N = Intel Pentium 4 and compatible Intel processors.
- B = Intel Pentium M and compatible Intel processors.
- P = Intel Pentium® 4 processors with Streaming SIMD Extensions
3 (SSE3)
On Intel® EM64T systems, W and P are the only valid processor
values. |
IA-32 systems: OFF
Intel® EM64T systems: W
|
| /Za |
-strict-ansi |
all |
This option enforces strict conformance to the ANSI standard
for C.
|
OFF |
/Zi |
-g |
all |
This option tells the compiler to generate symbolic debugging
information in the object file for use by debuggers.
The compiler does not support the generation of debugging information
in assemblable files. If you specify this option, the resulting
object file will contain debugging information, but the assemblable
file will not.
This option turns off O2 and makes O0 (Linux) or Od (Windows)
the default unless O2 (or another O option) is explicitly specified
in the same command line.
On Linux IA-32 systems, specifying the g or O0 option sets the
fp option.
|
OFF |