BCT optimization
Michael Hayes
m.hayes@elec.canterbury.ac.nz
Wed Sep 30 17:36:00 GMT 1998
Jeffrey A Law writes:
> Get rid of the magic COUNT_REGISTER_REGNUM stuff. There's no reason to use a
> hard register. Use a pseudo and let the register allocators and reload DTRT.
That's the first thing I got rid of. I suggested to David that we
emit a pattern at the start of a BCT loop, tentatively named
init_branch_on_count, that sets up the loop count (and possibly emits
the looping instruction for targets that have such an instruction at
the top of a loop). The operands for this pattern would include a
label marking the start of the loop; a label marking the end of the
loop; an iteration count; and possibly a loop depth count (for
architectures that support nested zero overhead looping constructs,
e.g, the ADI SHARC).
At the end of the loop we emit another named pattern
decrement_and_branch_on_count. Now this pattern needs to be tightly
coupled with init_branch_on_count since it needs to know what register
has been assigned the iteration count, for example. The more I think
about this, the best way appears to be using static variables in the
backend, in a similar manner to compare and jump patterns.
Michael.
More information about the Gcc
mailing list