Inside the Intel Compiler

How did Intel's compiler beat gcc on Benchmarks? Intel's compiler developers explain IA-32 optimizations they use.
Language Extensions

While the Intel compiler is strictly ANSI-compliant, there are options to cover many GCC extensions, such as long long int, zero-length arrays or macros with variable number of arguments. GCC-style inline assembly code is also supported. DWARF2 debugging information is provided to use with standard debuggers such as GDB. Certain Microsoft extensions are also enabled, such as __declspec attributes, along with support for Microsoft-style inline assembly code.

In addition to inline assembly code, the Intel compiler also supports MMX and SSE/SSE2 intrinsics. These allow access to the processor-specific extensions without the performance and correctness problems often caused by using inline assembly that can interfere with the analysis and transformations of the Intel compiler. By using the provided intrinsics, the programmer can take advantage of specific instructions but still receive the benefits of register allocation, scheduling and other optimizations.

Conclusions

The Intel compiler for Linux is a state-of-the-art compiler that delivers performance among the best in the industry, using sophisticated techniques to enable advanced features of Intel IA-32 architectures. More information can be found at developer.intel.com/software/products/compilers.

Acknowledgements

Thanks to Zia Ansari and David Kreitzer for their help in describing some of the technical details of the compiler. We also thank all the other members of the Intel compiler team.

Intel, Pentium, Itanium and MMX are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

Resources

Dale Schouten (Dale.A.Schouten@intel.com) works at the Intel Compiler Lab. He has a PhD from the University of Illinois. In his other life, Dale is an unprofessional musician and the father of two exceptional children.

Xinmin Tian (Xinmin.Tian@intel.com) works at the Intel Compiler Lab at Intel Corp. He manages the OpenMP Parallelization group. He holds BSc, MSc and PhD degrees in Computer Science from Tsinghua University.

Aart Bik (Aart.Bik@intel.com) received his MSc degree in Computer Science from Utrecht University, The Netherlands, and his PhD degree from Leiden University, The Netherlands. He is currently working on vectorization and parallelization at the Intel Compiler Lab.

Milind Girkar (Milind.Girkar@intel.com) received a PhD degree in Computer Science from the University of Illinois at Urbana-Champaign. Currently, he manages the IA-32 Compiler Development group at the Intel Compiler Lab.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Inside the Intel Compiler

Anonymous's picture

I have tried both gcc and icc 7.0 on cache-intensive code. Also examined the intermediate assembly code. Same code, same performance (better comments for icc), provided that you compile (under gcc) for the right processor type. Default processor is 386 (!!!) for some distributions (e.g., Mandrake), pentium for others (e.g., RedHat). Be careful, the performance advantage can be up to 40%.
Of course, no OpenMP support for gcc. However, when Intel people will dare to make measurements with hyperthreading enabled (please read their papers carefully), I will convice myself that it MIGHT be useful.. :)

Re: Inside the Intel Compiler

Anonymous's picture

Some of the optimizations shown were just part of good proramming practice anyway.
Only extreme newbies wold program as shown before optimization.

Re: Inside the Intel Compiler

Anonymous's picture

dare to say the current gcc has most of this stuff already implemented.

Re: Inside the Intel Compiler

Anonymous's picture

When did GCC get vectorization and OpenMP support?

Re: Inside the Intel Compiler

Anonymous's picture

3.2 has pretty good vectorization support, not the best but pretty good

Re: Inside the Intel Compiler

Anonymous's picture

Re: Inside the Intel Compiler

Anonymous's picture

"dare to say the current gcc has most of this stuff already implemented."

Not true, although you'll find some things that work better in GCC. The Intel compiler is specifically optimized for IA, while gcc has to run on a lot of different architectures. Your mileage will vary depending on what you're doing.

GCC vs. the Intel Compiler definitely falls into the category of "use the right tool for the right job." Of course, the proprietary nature of the Intel tool will be an obstacle for some, but you can definitely get some performance benefits from using a compiler that is specificially optimized for the architecture.

Re: Inside the Intel Compiler

Anonymous's picture

well, this might be true, but it is still much slower in most benchmarks.

Re: Inside the Intel Compiler

Anonymous's picture

hmmm, it's posible create a Linux Distribution with Intel Compiler!!??

Re: Inside the Intel Compiler

Anonymous's picture

Well, in other articles people say it can't compile many things that are designed to be compiled with gcc (many linux packages) so I don't think it's feasible

Re: Inside the Intel Compiler

Anonymous's picture

AFAIK, no :(

Re: Inside the Intel Compiler

Anonymous's picture

AFAIK, Gentoo will be, maybe...

Re: Inside the Intel Compiler

Anonymous's picture

Nice article. I hadn't heard anything about OpenMP until now, or CPU dispatch.

One thing I'm curious about though is what stuff the compiler team uses to develop with.. e.g. What language(s) are the C/C++ and Fortran compilers implemented in?

Some benchmarks I've seen would suggest they share a common back-end, but I wonder if the compiler itself is written in C, C++, Fortran or maybe a lisp dialect or some functional language..

The Intel Compiler is

Anonymous's picture

The Intel Compiler is written on pure C.

Re: Inside the Intel Compiler

Anonymous's picture

Umm I think they use a mix of PERL and OCaml.

They do the OpenMP stuff in functional Miranda.

lol

Anonymous's picture

lol

functional miranda
hahahah

Re: Inside the Intel Compiler

Anonymous's picture

How do you know?

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix