What makes the Intel Compiler generate such fast code?
This Linux Journal article written by members of Intel's Compiler Lab, explains some of the optimization methods used by Intel's compiler. It covers icc-specific optimizations (like using OpenMP for automatic parallelization, intra-register vectorization using MMX, SSE, and SSE2), as well as traditional optimization techniques (dead code elimination, inlining, etc.)
Ah, er..
Why isn't this being posted? The front page is growing mould...
Nice advert what about the patents?
The article reads as an advert for the intel complier. Shouldn't it have been why can't gcc use such algorithms? Oh, it's because intel have patented them!
Re.: Nice advert
Well, it *is* written by intel developers. Apart from that, though, I agree with you on the patent issue - I think the whole idea of being able to patent algorithms is an unholy abomination that should be gotten rid of as soon as possible.
--
schnee
patents?
you guess the algoithms are patented or you know?
I think that are pretty standard algorithms from compiler books or sigplan articles.
compiler books
subexpression elimination is 30+ years old. If you use the DAG-based parse trees, you get it for free.
condition propagation ... given the volatility of the flags register, the limited number of i386 registers, and the low cost of doing a comparison, this doesn't seem like it would same much time. Maybe if you doubled your code...
if (x > 0) { do this if (x > 5){ do that } } to if (x > 5) { do this } else if (x > 0) { do this do that }you could avoid some branch predictions.
vector optimizing ... inlined, it could be a nice boost, if you know that memory doesn't overlap, or fall on odd boundaries. gcc already replaces constant-length memcpy with string ops, which are slower than vector moves, but guaranteed to work on all i386s.
Re: advert
Fucktard alert. RTFA.
The article originally appeared on Linux Journal, and it's focus is on the intel compiler -- not gcc.
Also, none of optimization techniques in the article are things that GCC can't use due to patent encumberances, it just doesn't.