Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
8 Views

enabling -ipo can greatly reduce performance in Linux

Jump to solution
Usually it produces faster code, but I already noticed two programs where it results in very slow binaries.One of them is the following compression program.

http://mattmahoney.net/dc/zp100.zip
[plain]openssl rand 1000000 -out random

icpc -O3 -xSSE3_ATOM -o zp zp.cpp
./zp c3 random.zp random
Elapsed time 20.52 seconds.

icpc -O3 -o zp zp.cpp
./zp c3 random.zp random
Elapsed time 21.34 seconds.

icpc -O3 -xSSE3_ATOM -ipo -o zp zp.cpp
./zp c3 random.zp random
Elapsed time 29.74 seconds.

icpc -O3 -ipo -o zp zp.cpp
./zp c3 random.zp random
Elapsed time 35.08 seconds.[/plain]
This is with 11.1.072 and an Intel Atom processor.
0 Kudos

Accepted Solutions
Highlighted
Employee
8 Views
Try -ip (interprocedural optimization within single file) which is more suitable for the example than -ipo (dto. within multiple files). It gives slightly better performance.
Did you try -ipo also with multiple file compilations?
Hubert.

View solution in original post

0 Kudos
4 Replies
Highlighted
Employee
8 Views
Yes, ipo code is slower. I'll have a look at it.
Regards, Hubert.
0 Kudos
Highlighted
Employee
9 Views
Try -ip (interprocedural optimization within single file) which is more suitable for the example than -ipo (dto. within multiple files). It gives slightly better performance.
Did you try -ipo also with multiple file compilations?
Hubert.

View solution in original post

0 Kudos
Highlighted
New Contributor I
8 Views
Actually I have completely ignored that this is only a single source file for some reason. Probably because I automatically try -fast first which then expands into -ipo and other switches. The other example where -ipo produces much slower code is only one source file as well.

Maybe in the case of -fast with only a single source file the compiler could warn about this to help the user?
In cases with multiple files -ipo produces faster code.
Thanks for you reply.
0 Kudos
Highlighted
New Contributor I
8 Views
I've tried another single source file, and while -ipo obviously didn't produce faster code it wasn't slower either. So this could still be a bug.
0 Kudos