------- Comment #5 from mkgnu at mkgnu dot net  2007-04-25 02:12 -------
(In reply to comment #3)
> I've tried a couple of different ways to use branch predictions for
> partitioning, but it never leads to meaningful results.  Either everything is
> hot or everything is cold.  I don't know what else to do about this.

Steven, perhaps you could elaborate what you mean by saying "it never leads to
meaningful results" ?

> I'm actually tempted to claim this is a WONTFIX because "hot" and "cold" are
> not meaningful without profile information.  Thoughts, anyone?

I'm working on a research prototype in which I produce code that should be cold
for a considerable amount of time when a program runs. After some time (or
perhaps never), when a flag is raised, we'd like to use the cold code just
once, and then revert the program back to it's original behavior of running
only hot code.

Apparently, as bug 31689 shows, I need this feature. In this research prototype
I am 100% certain that a piece of code will be cold -- there's no need to
gather profiling information, and I absolutely need this code to be out of the
.text section.

Using this research prototype, I ran experiments that demonstrate a slowdown in
computation-bound applications in the range of 4%-300% on the i386 and PowerPC
architectures depending on the size of the processor i-cache. I believe that
moving the cold code sections out of .text will bring the overhead down to less
than 4%, constantly.

I absolutely, positively, definitely find value in this feature. In fact, my
research progress depends on it and I am actively looking for a way to have
this implemented.

Can you help ?

I've tried using __builtin_expect() and -freorder-blocks-and-partition with gcc
4.1.2 and it doesn't seem to work. If there's a patch laying around that
implements this feature without gathering profiling information I would love to
try it out immediately.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26493

Reply via email to