The idea is to position the basic blocks of a procedure in such a way that most executions of the code will fall through branches (forward branches are typically predicted to not be taken). This minimizes the cost of branch mispredictions, and keeps commonly executed code together. The latter will have the effect of making best use of the instruction cache, and minimizing cache collisions.

Such optimal positioning of basic blocks can be very effective at speeding up programs, especially when the information about branch frequencies is obtained dynamically (i.e. as the program is running).

-- MikeVanEmmerik - 01 Dec 2001

Revision: r1.1 - 01 Dec 2001 - 14:11 - MikeVanEmmerik
Transform > ProgramOptimization > BasicBlockPositioning
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback