Informatika Komputer    
   
Daftar Isi
(Sebelumnya) Integrity (operating system)Intel Cilk Plus (Berikutnya)

Intel C++ Compiler

Intel C++ Compiler
Developer(s)Intel
Stable release13.0 / September 5, 2012; 6 months ago (2012-09-05)
Operating systemLinux, Mac OS X and Microsoft Windows
TypeCompiler
LicenseCommercial, Academic, Eval and, for Linux, for non-commercial uses[1]
Websitehttp://software.intel.com/en-us/intel -compilers/

Intel C++ Compiler, also known as icc or icl, is a group of C and C++ compilers from Intel Corporation available for Apple Mac OS X, Linux and Microsoft Windows.

Contents

Overview

The compilers generate code for IA-32 and Intel 64 architectures and certain non-Intel but compatible processors, such as certain AMD processors. A specific release of the compiler (11.1) is available for development of Linux-based applications for IA-64 (Itanium 2) processors.

The 13.0 release adds support for the Intel Xeon Phi coprocessor. It continues support for automatic vectorization, which can generate SSE[disambiguation needed], SSE2, SSE3, SSSE3, SSE4, AVX and AVX2 SIMD instructions, and the embedded variant for Intel MMX and MMX 2.[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 continue support for Intel 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 3.1, symmetric multiprocessing, automatic parallelization, and Guided Auto-Parallization (GAP). 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 OS X, it is compatible with GNU Compiler Collection (GCC) and the GNU toolchain. 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 (IPO), profile-guided optimization (PGO), and high-level optimizations (HLO). It also supports tools, techniques and language extensions, such as Intel Cilk Plus, for adding and maintaining application parallelism on IA-32 and Intel 64 processors, and enabling application offloading to Intel coprocessors, such as the Intel Xeon Phi coprocessor.

Intel Cilk Plus adds language extensions to C++ to express data and task-parallelism. Cilk_spawn and Cilk_sync are keywords to enable task parallelism and the Cilk_for keyword enables parallelization of for loops. It also provides vector notation with array notations and elemental function capabilities.

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 unrolling, loop distribution, data prefetch, and more.[3]

Interprocedural optimization applies typical compiler optimizations (such as constant propagation) but using a broader scope that may include multiple procedures, multiple files, or the entire program.[4]

With the September 5, 2012 launch (the 13.0 launch), the Windows-based releases of Intel Parallel Studio XE and Intel C++ Studio XE, each of which include Intel C++, also include a performance guide. This is a GUI-based compiler tool that provides step-by-step advice concerning changes to code that could result in improved application performance.

Intel's compiler has been criticized for applying, by default, floating-point optimizations not allowed by the C standard and that require special flags with other compilers such as gcc.[5]

Architectures

Description of Packaging

Intel C++ 13.0 compilers are not available as stand-alone compilers. They are available in packages, some of which include other build-tools, such as libraries, and other which include performance and threading analysis tools. Intel C++ is part of Intel Parallel Studio XE and Intel C++ Studio XE, which are available for Windows and Linux and which include performance analysis and thread-diagnostic tools. Intel C++ Composer XE (available for Windows, Linux and Apple OS X) and Intel Composer XE, which also includes Intel Fortran (available for Windows and Linux) do not include the analysis and thread-diagnostic tools. Intel compilers are also included in Intel Cluster Studio (no analysis tools) and Intel Cluster Studio XE (analysis tools included). The cluster tools are available for Windows and Linux. Packages that include Intel C++ also include the Intel Math Kernel Library (Intel MKL), Intel Integrated Performance Primitives (Intel IPP) and Intel Threading Building Blocks (Intel TBB). Fortran-only packages only include Intel MKL.[6]

Ten year version history

Compiler versionRelease dateMajor new features
Intel C++ Composer XE 2013 (compiler 13.0)September 5, 2012Linux-based support for Intel Xeon Phi coprocessors, support for Microsoft Visual Studio 12 (Desktop), support for gcc 4.7, support for Intel AVX 2 instructions, updates to existing functionality focused on improved application performance.[7]
Intel C++ Composer XE 2011 Update 6 and above (compiler 12.1)September 8, 2011Intel Cilk Plus language extensions updated to support specification version 1.1 and available on Mac OS X in addition to Windows and Linux, Intel 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 2011 up to Update 5 (compiler 12.0)Nov 7, 2010Intel Cilk Plus language extensions, Guided Auto-Parallelism, Improved C++11 support.[8]
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++ 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 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 10.0June 5, 2007Improved parallelizer and vectorizer, Streaming SIMD Extensions 4 (SSE4), new and enhanced optimization reports for advanced loop transformations, new optimized exception handling implementation.
Intel C++ Compiler 9.0June 14, 2005AMD64 architecture (for Windows), software-based speculative pre-computation (SSP) optimization, improved loop optimization reports.
Intel C++ Compiler 8.1September, 2004AMD64 architecture (for Linux).
Intel C++ Compiler 8.0December 15, 2003Precompiled headers, code-coverage tools.

Flags and manuals

Documentation can be found at the Intel Software Technical Documentation site.

WindowsLinux & Mac OS XComment
/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
/QxO-xOEnables SSE3, SSE2 and SSE instruction sets optimizations for non-Intel CPUs [9]
/fast-fastShorthand. On Windows this equates to "/O3 /Qipo /QxHost /no-prec-div"  on Linux "-O3 -ipo -static -xHOST -no-prec-div". Note that the processor specific optimization flag (-xHOST) will optimize for the processor compiled on—it is the only flag of -fast, which 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 (DWARF 2 on Linux, similar to gdb, and COFF for Windows). 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 as a separate product called VTune. VTune features an easy-to-use GUI (integrated into Visual Studio for Windows, Eclipse for Linux) as well as a command-line interface.

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 (both heap and stack), deadlocks and thread and synch API errors.

Criticism

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.[10][11] Nevertheless, the Intel compilers have been accused of producing sub-optimal code with malicious intent. For example, Steve Westfield wrote in a 2005 article at the AMD website:[12]

Intel 8.1 C/C++ compiler uses the flag -xN (for Linux) or -QxN (for Windows) to take advantage of the SSE2 extensions. For SSE3, the compiler switch is -xP (for Linux) and -QxP (for Windows). [...] With the -xN/-QxN and -xP/-QxP flags set, it checks the processor vendor string—and if it's not "GenuineIntel," it stops execution without even checking the feature flags. Ouch!

The Danish developer and scholar Agner Fog wrote in 2009:[13]

The Intel compiler and several different Intel function libraries have suboptimal performance on AMD and VIA processors. The reason is that the compiler or library can make multiple versions of a piece of code, each optimized for a certain processor and instruction set, for example SSE2, SSE3, etc. The system includes a function that detects which type of CPU it is running on and chooses the optimal code path for that CPU. This is called a CPU dispatcher. However, the Intel CPU dispatcher does not only check which instruction set is supported by the CPU, it also checks the vendor ID string. If the vendor string is "GenuineIntel" then it uses the optimal code path. If the CPU is not from Intel then, in most cases, it will run the slowest possible version of the code, even if the CPU is fully compatible with a better version.

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.[13] A legal battle between AMD and Intel over this and other issues has been settled in November 2009.[14] In late 2010, AMD settled an US Federal Trade Commission antitrust investigation against Intel.[15]

The FTC settlement included a disclosure provision where Intel must:[16]

...publish clearly that its compiler discriminates against non-Intel processors (such as AMD's designs), not fully utilizing their features and producing inferior code.

In compliance with this rule, Intel added an "optimization notice" to its compiler descriptions stating that they "do not optimize equally for non-Intel microprocessors" and that "certain compiler options for Intel compilers, including some that are not specific to Intel micro-architecture, are reserved for Intel microprocessors". It says that:

Intel® compilers, associated libraries and associated development tools may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include Intel® Streaming SIMD Extensions 2 (Intel® SSE2), Intel® Streaming SIMD Extensions 3 (Intel® SSE3), and Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) instruction sets and other optimizations.

See also

References

  1. ^ "Non-Commercial Software Development". Developer Zone. Intel. http://software.intel.com/en-us/non-c ommercial-software-development. Retrieved 11 October 2012.
  2. ^ A. J. C. Bik, The Software Vectorization Handbook (Intel Press, Hillsboro, OR, 2004), ISBN 0-9743649-2-4.
  3. ^ The Software Optimization Cookbook, High-Performance Recipes for IA-32 Platforms, Richard Gerber, Aart J.C. Bik, Kevin B. Smith, and Xinmin Tian, Intel Press, 2006
  4. ^ Intel C++ Compiler XE 13.0 User and Reference Guides
  5. ^ The pitfalls of verifying floating-point computations, by David Monniaux, also printed in ACM Transactions on programming languages and systems (TOPLAS), May 2008; section 4.3.2 discusses nonstandard optimizations.
  6. ^ Intel Software Products site provides more information
  7. ^ Intel C++ Composer XW 2013 Release Notes[1] http://software.intel.com/en-us/artic les/intel-c-composer-xe-2013-release- notes/
  8. ^ This note is attached to the release in which Cilk Plus was introduced. This ULR points to current documentation: http://software.intel.com/en-us/intel -composer-xe/
  9. ^ "Intel® Compilers | Intel® Developer Zone". Intel.com. 1999-02-22. http://www.intel.com/software/product s/compilers/docs/cwin/release_notes.h tm. Retrieved 2012-10-13.
  10. ^ [2][dead link]
  11. ^ http://developer.amd.com/Assets/Compi lerOptQuickRef-61004100.pdf
  12. ^ Your Processor, Your Compiler, and You: The Case of the Secret CPUID String
  13. ^ a b Intel's "cripple AMD" function
  14. ^ http://download.intel.com/pressroom/l egal/AMD_settlement_agreement.pdf
  15. ^ "Intel and U.S. Federal Trade Commission Reach Tentative Settlement". Newsroom.intel.com. 2010-08-04. http://newsroom.intel.com/community/i ntel_newsroom/blog/2010/08/04/intel-a nd-us-federal-trade-commission-reach- tentative-settlement. Retrieved 2012-10-13.
  16. ^ FTC, Intel Reach Settlement; Intel Banned From Anticompetitive Practices

External links

(Sebelumnya) Integrity (operating system)Intel Cilk Plus (Berikutnya)