Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-03-01 Thread Mark Mitchell
Caroline Tice wrote: There might be some validity in the idea of modifying this optimization, in the future, to consider the size of a basic block in addition to it's "hot-ness", when deciding which partition to put it into. I expect this would not be that difficult to implement, and would proba

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-03-01 Thread Caroline Tice
I apologize for not responding to these messages sooner; I was out of town for a few days and only just read them. In the first place, I am a little confused about exactly what Joern is objecting to. If I am reading your emails correctly, you seem to feel that the hot/cold partitioning optimiz

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Joern RENNECKE
Dale Johannesen wrote: No, you should not turn on partitioning in situations where code size is important to you. You are missing the point. In my example, with perfect profiling data, you still end up with more code in the hot section, Yes. i.e. more pages are actually swapped in. Unles

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Dale Johannesen
On Feb 28, 2005, at 10:19 AM, Joern RENNECKE wrote: Dale Johannesen wrote: Certainly. In general it will make the total size bigger, as does inlining. If you have good information about what's hot and cold, it should reduce the number of pages that actually get swapped in. The information h

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Joern RENNECKE
Dale Johannesen wrote: Certainly. In general it will make the total size bigger, as does inlining. If you have good information about what's hot and cold, it should reduce the number of pages that actually get swapped in. The information has to be good, though, as a branch from hot<->cold

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Jeffrey A Law
On Mon, 2005-02-28 at 10:01 -0800, Dale Johannesen wrote: > On Feb 28, 2005, at 4:43 AM, Joern RENNECKE wrote: > > > Dale Johannesen wrote: > > > >>Well, no, what is supposed to happen (I haven't tried it for a > >> while, so I don't promise > >> this still works) is code like this: > >> > >>

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Dale Johannesen
On Feb 28, 2005, at 4:43 AM, Joern RENNECKE wrote: Dale Johannesen wrote: Well, no, what is supposed to happen (I haven't tried it for a while, so I don't promise this still works) is code like this: .hotsection: loop: conditional branch (i?==1000) to L2 L1: /* do stuff */ end loop: /* sti

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Jakub Jelinek
On Mon, Feb 28, 2005 at 12:43:35PM +, Joern RENNECKE wrote: > Well, even then, using of the cold section can increase the hot section > size, depending on target, and for some > targets the maximum supported distance of the cold section. > > For SH, using the cold section, you get (for non-PI

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-28 Thread Joern RENNECKE
Dale Johannesen wrote: Well, no, what is supposed to happen (I haven't tried it for a while, so I don't promise this still works) is code like this: .hotsection: loop: conditional branch (i?==1000) to L2 L1: /* do stuff */ end loop: /* still in hot section */ L2: jmp L3 .coldsection: L3

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-25 Thread Dale Johannesen
On Feb 25, 2005, at 9:47 AM, Joern RENNECKE wrote: consider: for (;;i++ ) { if (i == 1000) i = 0; /* do stuff... */ } The "i = 0;" statement is in its own cold block. On a number of targets, a conditional jump can't reach the cold section, so you'd have to replace a condjump around a s

Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)

2005-02-25 Thread Joern RENNECKE
In http://gcc.gnu.org/wiki/Hot%20and%20Cold%20Partitioning, you wrote: > Modifying the hot/cold partitioning optimization to make sure ALL the > hot blocks come before ALL the cold blocks in the RTL representation. > This in turn will allow for the elimination of the UNLIKELY notes in > each cold b