Shorten_branches and max_skip patch
Wed Jul 21 12:09:00 GMT 1999
Sorry, my idea yesterday was indeed flawed, it breaks down when the
same alignment log was seen before.
On the other hand, your approach still has the problem that it significantly
increases the execution time of the comiler.
It is possible to code shorten_branches so that it does its work
so that it accurately handles max_skip, but that would make the code
How about just treating the anti-cache-line-straddling alignments as
using up their maximum space for purposes of shorten_branches?
I suspect that will still get better results than your approach, since
a cache line is typically 32 bytes and the maximum requires space
should average below 2.
One way to do this is to insert unspec_volatile insns between labels and their
following insn during MACHINE_DEPENDENT_REORG.
These unspec_volatile insns would then print as the alignment and max_skip
that you want. Since the alignment for the label will be emitted first,
you'll get the alignment with the lower log first, so that the result
will indeed make sense.
More information about the Gcc-patches