Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7693 Discussions

Investigating Intel compiler optimization capabilities

watanabe__hiroshi
665 Views

Hello,

I've found that some codes compiled by the Intel compiler are significantly slower than those by GCC.
Here is a sample code.

https://github.com/kaityo256/compiler_test

This is a Monte Carlo simulation code of the Potts model which is one of the fundamental models in statistical physics.

Here is a benchmark result.

* Compile Options

g++ -O3 -march=native -Wall -Wextra -std=c++11  main.cpp -o gcc.out
icpc -O3 -xHOST -Wall -Wextra -std=c++11  main.cpp -o icpc.out

* Environment

CPU: Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
OS: CentOS Linux release 7.6.1810 (Core)
GCC: g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
icpc: icpc (ICC) 19.0.4.243 20190416

$ ./gcc.out
Magnetization : 0.891599
Elapsed : 305 [ms]

$ ./icpc.out
Magnetization : 0.891599
Elapsed : 880 [ms]

The two executables give the identical result, but the executable produced by Intel compiler is significantly slower than that by GCC.

I want to figure out what is happening here and write an article (maybe in Japanese). But I am afraid that the detailed analysis of optimization can be regarded as "reverse engineering" which is inhibited in EULA, since the investigation may reveal the limitations of optimization capabilities of the Intel compiler.

I am going to compare assembly codes produced by GCC and the Intel compiler, but I will not decompile the Intel compiler.

Does the above attempt violate EULA?

Thanks in advance.

0 Kudos
1 Solution
Viet_H_Intel
Moderator
665 Views

Yes, you can generate the assembly file and compare with other compiler's generated code.

View solution in original post

2 Replies
Viet_H_Intel
Moderator
666 Views

Yes, you can generate the assembly file and compare with other compiler's generated code.

watanabe__hiroshi
665 Views

Thank you very much!

I will write a report somewhere.

Reply