LWN.net Logo

The problem with prefetch

The problem with prefetch

Posted May 25, 2011 6:16 UTC (Wed) by bronson (subscriber, #4806)
Parent article: The problem with prefetch

Reminds me of the register keyword. For a few years programmers put 'register' on just about any int that was used more than once... Turns out that in almost every case that was slowing things down. Compilers tend to chose better register variables than programmers.


(Log in to post comments)

The problem with prefetch

Posted May 25, 2011 21:18 UTC (Wed) by vonbrand (subscriber, #4458) [Link]

Somebody told me there are three kinds of C compilers: Dumb ones (they just disregard register), smart ones (they heed register if possible) and very smart ones (they asign registers better than whatever the programmer could hint at, and just overlook register). Current compilers are mostly in the third group.

The problem with prefetch

Posted Jun 2, 2011 13:17 UTC (Thu) by marcH (subscriber, #57642) [Link]

I find a _reasonable_ use of "register" still useful for programmer to programmer communication anyway. It seldom hurts to express a (good) intent.

The problem with prefetch

Posted Jun 7, 2011 12:04 UTC (Tue) by etienne (subscriber, #25256) [Link]

Using "register" also means that the address of that number shall not be taken, so should have consequences on aliasing optimisation (you have a warning if modifying that code and take address of that variable, maybe this would have big difference in execution speed).

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