LWN.net Logo

Quotes of the week

Quotes of the week

Posted Aug 25, 2012 3:56 UTC (Sat) by daglwn (subscriber, #65432)
In reply to: Quotes of the week by cmccabe
Parent article: Quotes of the week

> Independently of that, what modern compilers have done with the
> traditional inline keyword is ridiculous.

Of course it isn't. I don't think you quite appreciate how difficult it is to get inlining right. Do too much and you blow the instruction cache or create too much register pressure. Do too little and you unnecessarily inhibit program transformation.

It's a very tricky balance, one that must be maintained differently not only based on target architecture but also on input language.

Compilers change inlining so frequently precisely because they get better and better at generating code.


(Log in to post comments)

Quotes of the week

Posted Aug 25, 2012 22:50 UTC (Sat) by lindahl (subscriber, #15266) [Link]

Treatment of "inline" is the same as how compilers treat "register" declarations and loop-unrolling pragmas -- after a few years of cpu evolution and compiler improvements, these hints are always wrong.

And those pesky customers who care about performance expect the compiler to DTRT despite all the bogus "inline", "register" declarations, and loop-unrolling pragmas scattered all over their code.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds