dmd.backend.blockopt

Manipulating basic blocks and their edges.

Members

Functions

block_appendexp
void block_appendexp(block* b, elem* e)

Append elem to the elems comprising the current block. Read in an expression and put it in curblock.Belem. If there is one already there, create a tree like: , / \ old e

block_clearvisit
void block_clearvisit()

Clear visit.

block_compbcount
void block_compbcount()

Compute number of parents (Bcount) of each basic block.

block_endfunc
void block_endfunc(int flag)

Mark end of function. flag: 0 do a "return" 1 do a "return 0"

block_free
void block_free(block* b)

Free a block.

block_goto
block* block_goto(Blockx* bx, int bc, block* bn)

Finish up this block and start the next one.

block_goto
void block_goto()

Goto a block named gotolbl. Start a new block that is labelled by newlbl.

block_goto
void block_goto(block* bn)

Goto a block named gotolbl. Start a new block that is labelled by newlbl.

block_goto
void block_goto(block* bgoto, block* bnew)

Goto a block named gotolbl. Start a new block that is labelled by newlbl.

block_initvar
void block_initvar(Symbol* s)

Mark curblock as initializing Symbol s.

block_next
void block_next(Blockx* bctx, int bc, block* bn)

Finish up this block and start the next one.

block_optimizer_free
void block_optimizer_free(block* b)

Free optimizer gathered data.

block_pred
void block_pred()

Build predecessor list (Bpred) for each block.

block_ptr
void block_ptr()

Replace block numbers with block pointers.

block_term
void block_term()
block_visit
void block_visit(block* b)

Visit block and each of its predecessors.

blocklist_free
void blocklist_free(block** pb)

Free list of blocks.

blockopt
void blockopt(int iter)

Perform branch optimization on basic blocks.

brcombine
void brcombine()

Try to remove control structure. That is, try to resolve if-else, goto and return statements into &&, || and ?: combinations.

compdfo
void compdfo()

Compute depth first order (DFO). Equivalent to Aho & Ullman Fig. 13.8. Blocks not in dfo[] are unreachable.

funcsideeffects
void funcsideeffects()

Determine if function has any side effects. This means, determine if all the function does is return a value; no extraneous definitions or effects or exceptions. A function with no side effects can be CSE'd. It does not reference statics or indirect references.

Static variables

bc_goal
goal_t[BCMAX] bc_goal;

Meta

Suggestion Box / Bug Report