Intel C++ Compiler


Intel C++ Compiler, also known as icc or icl, is a group of C and C++ compilers from Intel available for Windows, Mac, Linux, FreeBSD and Intel-based Android devices.

Overview

The compilers generate optimized code for IA-32 and Intel 64 architectures, and non-optimized code for non-Intel but compatible processors, such as certain AMD processors. A specific release of the compiler is available for development of Linux-based applications for IA-64 processors.
The 14.0 compiler added support for Intel-based Android devices and optimized vectorization and SSE Family instructions for performance. The 13.0 release added support for the Intel Xeon Phi coprocessor. It continues support for automatic vectorization, which can generate SSE, SSE2, SSE3, SSSE3, SSE4, AVX and AVX2 SIMD instructions, and the embedded variant for Intel MMX and MMX 2. Use of such instruction through the compiler can lead to improved application performance in some applications as run on IA-32 and Intel 64 architectures, compared to applications built with compilers that do not support these instructions.
Intel compilers support Cilk Plus, which is a capability for writing vectorized and parallel code that can be used on IA-32 and Intel 64 processors or which can be offloaded to Xeon Phi coprocessors. They also continue support for OpenMP 4.0, symmetric multiprocessing, automatic parallelization, and Guided Auto-Parallization. With the add-on Cluster OpenMP capability, the compilers can also automatically generate Message Passing Interface calls for distributed memory multiprocessing from OpenMP directives.
Intel C++ is compatible with Microsoft Visual C++ on Windows and integrates into Microsoft Visual Studio. On Linux and Mac, it is compatible with GNU Compiler Collection and the GNU toolchain. Intel C++ Compiler for Android is hosted on Windows, OS X or Linux and is compatible with the Android NDK, including gcc and the Eclipse IDE. Intel compilers are known for the application performance they can enable as measured by benchmarks, such as the SPEC CPU benchmarks.

Optimizations

Intel compilers are optimized to computer systems using processors that support Intel architectures. They are designed to minimize stalls and to produce code that executes in the fewest possible number of cycles. The Intel C++ Compiler supports three separate high-level techniques for optimizing the compiled program: interprocedural optimization, profile-guided optimization, and high-level optimizations. The Intel C++ compiler in the Parallel Studio XE products also supports tools, techniques and language extensions for adding and maintaining application parallelism on IA-32 and Intel 64 processors and enables compiling for Intel Xeon Phi processors and coprocessors.
Profile-guided optimization refers to a mode of optimization where the compiler is able to access data from a sample run of the program across a representative input set. The data would indicate which areas of the program are executed more frequently, and which areas are executed less frequently. All optimizations benefit from profile-guided feedback because they are less reliant on heuristics when making compilation decisions.
High-level optimizations are optimizations performed on a version of the program that more closely represents the source code. This includes loop interchange, loop fusion, loop fission, loop unrolling, data prefetch, and more.
Interprocedural optimization applies typical compiler optimizations but using a broader scope that may include multiple procedures, multiple files, or the entire program.
David Monniaux has criticized Intel's compiler for applying, by default, floating-point optimizations which are not allowed by the C standard and which require special flags with other compilers such as gcc.

Architectures

Except for the Intel Bi-Endian C++ Compiler, Intel C++ compilers are not available in standalone form. They are available in suites:
The suites include other build tools, such as libraries, and tools for threading and performance analysis.

History since 2003

Compiler versionRelease dateMajor new features
Intel C++ Compiler 8.0December 15, 2003Precompiled headers, code-coverage tools.
Intel C++ Compiler 8.1September, 2004AMD64 architecture.
Intel C++ Compiler 9.0June 14, 2005AMD64 architecture, software-based speculative pre-computation optimization, improved loop optimization reports.
Intel C++ Compiler 10.0June 5, 2007Improved parallelizer and vectorizer, Streaming SIMD Extensions 4, new and enhanced optimization reports for advanced loop transformations, new optimized exception handling implementation.
Intel C++ Compiler 10.1November 7, 2007New OpenMP* compatibility runtime library: if you use the new OpenMP RTL, you can mix and match with libraries and objects built by Visual C++. To use the new libraries, you need to use the new option "-Qopenmp /Qopenmp-lib:compat" on Windows, and "-openmp -openmp-lib:compat" on Linux. This version of the Intel compiler supports more intrinsics from Visual Studio 2005.
VS2008 support - command line only in this release. The IDE integration was not supported yet.
Intel C++ Compiler 11.0November 2008Initial C++11 support. VS2008 IDE integration on Windows. OpenMP 3.0. Source Checker for static memory/parallel diagnostics.
Intel C++ Compiler 11.1June 23, 2009Support for latest Intel SSE SSE4.2, AVX and AES instructions. Parallel Debugger Extension. Improved integration into Microsoft Visual Studio, Eclipse CDT 5.0 and Mac Xcode IDE.
Intel C++ Composer XE 2011 up to Update 5 November 7, 2010Cilk Plus language extensions, Guided Auto-Parallelism, Improved C++11 support.
Intel C++ Composer XE 2011 Update 6 and above September 8, 2011Cilk Plus language extensions updated to support specification version 1.1 and available on Mac OS X in addition to Windows and Linux, Threading Building Blocks updated to support version 4.0, Apple blocks supported on Mac OS X, improved C++11 support including support for Variadic templates, OpenMP 3.1 support.
Intel C++ Composer XE 2013 September 5, 2012Linux-based support for Intel Xeon Phi coprocessors, support for Microsoft Visual Studio 12, support for gcc 4.7, support for Intel AVX 2 instructions, updates to existing functionality focused on improved application performance.
Intel C++ Composer XE 2013 SP1 September 4, 2013Online installer; support for Intel Xeon Phi coprocessors; preview Win32 only support for Intel graphics; improved C++11 support
Intel C++ Composer XE 2013 SP1 Update 1 October 18, 2013Japanese localization of 14.0; Windows 8.1 and Xcode 5.0 support
Intel C++ Compiler for Android November 12, 2013Hosted on Windows, Linux, or OS X, compatible with Android NDK tools including the gcc compiler and Eclipse
Intel C++ Composer XE 2015 July 25, 2014Full C++11 language support; Additional OpenMP 4.0 and Cilk Plus enhancements
Intel C++ Composer XE 2015 Update 1 October 30, 2014AVX-512 support; Japanese localization
Intel C++ 16.0August 25, 2015Suite-based availability
Intel C++ 17.0September 15, 2016Suite-based availability
Intel C++ 18.0January 26, 2017Suite-based availability
Intel C++ 19.0April 03, 2018Suite-based availability

Flags and manuals

Documentation can be found at the .
WindowsLinux, macOS & FreeBSDComment
/Od-O0No optimization
/O1-O1Optimize for size
/O2-O2Optimize for speed and enable some optimization
/O3-O3Enable all optimizations as O2, and intensive loop optimizations
/arch:SSE3/-msse3Enables SSE3, SSE2 and SSE instruction sets optimizations for non-Intel CPUs
/fast-fastShorthand. On Windows this equates to "/O3 /Qipo /QxHost /Opred-div-" ; on Linux "-O3 -ipo -static -xHOST -no-prec-div". Note that the processor specific optimization flag will optimize for the processor compiled on—it is the only flag of -fast that may be overridden
/Qprof-gen-prof_genCompile the program and instrument it for a profile generating run
/Qprof-use-prof_useMay only be used after running a program that was previously compiled using prof_gen. Uses profile information during each step of the compilation process

Debugging

The Intel compiler provides debugging information that is standard for the common debuggers. The flags to compile with debugging information are /Zi on Windows and -g on Linux. Debugging is done on Windows using the Visual Studio debugger and, on Linux, using gdb.
While the Intel compiler can generate a gprof compatible profiling output, Intel also provides a kernel level, system-wide statistical profiler called Intel VTune Profiler. VTune can be used from a command line or thru an included GUI on Linux or Windows. It can also be integrated into Visual Studio on Windows, or Eclipse on Linux). In addition to the VTune profiler, there is Intel Advisor that specializes in vectorization optimization, offload modeling, flow graph design and tools for threading design and prototyping.
Intel also offers a tool for memory and threading error detection called Intel Inspector XE. Regarding memory errors, it helps detect memory leaks, memory corruption, allocation/de-allocation of API mismatches and inconsistent memory API usage. Regarding threading errors, it helps detect data races, deadlocks and thread and synch API errors.

Reception

Intel and third parties have published benchmark results to substantiate performance leadership claims over other commercial, open-source and AMD compilers and libraries on Intel and non-Intel processors. Intel and AMD have documented flags to use on the Intel compilers to get optimal performance on Intel and AMD processors. Nevertheless, the Intel compilers have been known to use sub-optimal code for processors from vendors other than Intel. For example, Steve Westfield wrote in a 2005 article at the AMD website:
The Danish developer and scholar Agner Fog wrote in 2009:
This vendor-specific CPU dispatching decreases the performance on non-Intel processors of software built with an Intel compiler or an Intel function library – possibly without the knowledge of the programmer. This has allegedly led to misleading benchmarks, including one incident when changing the CPUID of a VIA Nano significantly improved results. A legal battle between AMD and Intel over this and other issues has been settled in November 2009. In late 2010, AMD settled a US Federal Trade Commission antitrust investigation against Intel.
The FTC settlement included a disclosure provision where Intel must:
In compliance with this rule, Intel added an "optimization notice" to its compiler descriptions stating that they "may or may not optimize to the same degree for non-Intel microprocessors" and that "certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors". It says that:
As reported by The Register in July 2013, Intel was suspected of "benchmarksmanship", when it was shown that the object code produced by the Intel compiler for the AnTuTu Mobile Benchmark omitted portions of the benchmark which showed increased performance compared to ARM platforms.