This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)
- From: Dale Johannesen <dalej at apple dot com>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: gcc at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>, Dale Johannesen <dalej at apple dot com>, ctice at apple dot com
- Date: Fri, 25 Feb 2005 10:13:29 -0800
- Subject: Re: Hot and Cold Partitioning (Was: GCC 4.1 Projects)
- References: <421F64CA.6010008@st.com>
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 simple
instruction
by a condjump around an jump,
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:
i = 0;
jmp L1