This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]