[PATCH,4.2] Use edge probabilities to control speculation in interblock scheduler

Peter Steinmetz steinmtz@us.ibm.com
Thu Sep 1 15:29:00 GMT 2005


The interblock instruction scheduler computes static probabilities for
reaching the blocks of the region being scheduled.  It starts at the region
entry point with an assumed probability of 100% and distributes that
downward to the other blocks of the region, equally dividing the
probability amongst successor blocks, and assuming a small rate of escape
along paths that exit the region.  The scheduler uses these computed block
probabilities to determine the potential usefulness of speculatively moving
an instruction from one block to another.

A more accurate way to distribute the probability is to make use of the
edge probability data in the control flow graph.  In the absence of FDO,
the edge probabilities are set by static branch prediction.  When FDO data
is present, the actual counts are used to set the edge probabilities.

Using this approach gives the interblock scheduler a more accurate view of
the hot paths through the region and results in smarter decisions as to
which paths should be favored for speculative motions, and which paths
should be avoided.

Performance tests show that the generated code using edge probabilities
behaves equally well or better on PowerPC.

Bootstrapped and regtested on powerpc64-unknown-linux-gnu with no failures.

Ok for 4.2? .. could be considered for 4.1 since the code impact is minimal
and there is potential for improved performance.

Pete.
(See attached file: patch.use-edge-probabilities)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.use-edge-probabilities
Type: application/octet-stream
Size: 2244 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050901/8f4c373f/attachment.obj>


More information about the Gcc-patches mailing list