# HG changeset patch # User Thomas Wuerthinger # Date 1358508025 -3600 # Node ID 994f7ed25a46590370be2f4eede7b6f3f1d2452e # Parent ca3e5df0e6cfb854821536ad710a2cc6075eb3b8 Additional comment describing the block ordering and alignment. diff -r ca3e5df0e6cf -r 994f7ed25a46 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/ComputeBlockOrder.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/ComputeBlockOrder.java Fri Jan 18 12:11:01 2013 +0100 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/ComputeBlockOrder.java Fri Jan 18 12:20:25 2013 +0100 @@ -29,7 +29,19 @@ /** * Computes an ordering of the block that can be used by the linear scan register allocator and the machine code - * generator. + * generator. The machine code generation order will start with the first block and produce a straight sequence + * always following the most likely successor. Then it will continue with the most likely path that was left out during + * this process. The process iteratively continues until all blocks are scheduled. Additionally, it is guaranteed that + * all blocks of a loop are scheduled before any block following the loop is scheduled. + * + * The machine code generator order includes reordering of loop headers such that the backward jump is a conditional jump if there + * is only one loop end block. Additionally, the target of loop backward jumps are always marked as aligned. Aligning the target of conditional + * jumps does not bring a measurable benefit and is therefore avoided to keep the code size small. + * + * The linear scan register allocator order has an additional mechanism that prevents merge nodes from being scheduled if there is + * at least one highly likely predecessor still unscheduled. This increases the probability that the merge node and the corresponding + * predecessor are more closely together in the schedule thus decreasing the probability for inserted phi moves. Also, the algorithm sets + * the linear scan order number of the block that corresponds to its index in the linear scan order. */ public final class ComputeBlockOrder {