inlining or not inlining...

spir denis.spir at gmail.com
Fri Feb 11 03:51:04 PST 2011


On 02/11/2011 07:53 AM, so wrote:
>> While in isolation that's a good idea, how far should it be taken? Should the
>> compiler emit information on which variables wound up in which registers, and
>> why? What about other of the myriad of compiler optimizations?
>
> Isn't Inlining by far the most important (most practical) optimization among
> those that actually we can control?
> A few times i have seen comparisons here to similar languages and in most of
> them the inlining was the reason (only) for the inferior performance.
> I agree it would be awesome if the compilers had the ability to chose the best
> method, but comparisons show sometimes the opposite, i don't know maybe they
> are hand-picked for some reason.

I recently read a study using a dozen test cases to compare optimisations 
performed by 3 C compiler (IIRC: gcc, a win product, and an LLVM one). Very 
instructive, and even more surprising for me.
In every case, some optimsation was done by a compiler that others did not, or 
conversely. This let me think for a while... how come? Don't compiler authors 
know, more or less, what kinds or optimisation "tactics" *exist* in given 
situations? and thus are performed by others. Strange. If this is the case, 
then the world of programming definitely needs a public knowledge base 
dedicated to compiler technique, esp. on optimisation. A wiki, indeed.

denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list