Jump to content

User:Awesomeclaw/Code-Block Reordering

From Wikipedia, the free encyclopedia

Code Block Reordering

Code-Block Reordering is a compiler optimisation which involves re-ordering the basic blocks of a region of machine code in order to improve performance. A Code-Block Reordering pass is present in most modern optimising compilers and compiler frameworks including GCC and LLVM.

Benefits[edit]

Most modern computer processors include Instruction Cache. Instruction Caches increase the rate at which instructions can be executed by reducing the cost of fetching instructions, while Branch Predictors attempt to speculate on the direction taken by branches and other control flow instructions.

Many systems also include Branch Prediction units, which seek to predict which path will be taken by control flow instructions such as branches. By default, many branch predictors will predict that a branch is 'not taken', i.e. the instructions directly after the control flow instruction will be executed.

References[edit]

Category:Compiler optimizations Category:Data-flow analysis