View source code
Display the source code in dmd/backend/blockopt.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.backend.blockopt

Manipulating basic blocks and their edges.




block_appendexp(b, 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_calloc() Handle basic blocks.
block_calloc_i() Handle basic blocks.
block_clearvisit() Clear visit.
block_compbcount() Compute number of parents (Bcount) of each basic block.
block_endfunc(flag) Mark end of function.
block_free(b) Free a block.
block_goto(bx, bc, bn) Finish up this block and start the next one.
block_init() Handle basic blocks.
block_next(bctx, bc, bn) Finish up this block and start the next one.
block_optimizer_free(b) Free optimizer gathered data.
block_pred() Build predecessor list (Bpred) for each block.
block_ptr() Replace block numbers with block pointers.
block_term() Handle basic blocks.
block_visit(b) Visit block and each of its predecessors.
blocklist_free(pb) Free list of blocks.
blockopt(iter) Perform branch optimization on basic blocks.
brcombine() Try to remove control structure. That is, try to resolve if-else, goto and return statements into &&, || and ?: combinations.
compdfo() Compute depth first order (DFO). Equivalent to Aho & Ullman Fig. 13.8. Blocks not in dfo[] are unreachable.
compdfo(dfo, startblock) Handle basic blocks.
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.
mem_fcalloc(numbytes) Handle basic blocks.
mem_free() Handle basic blocks.

Manifest constants

SCPP_OR_NTEXCEPTIONS Handle basic blocks.

Global variables

bc_goal uint[20] Handle basic blocks.
blkzero Handle basic blocks.
block_freelist* Handle basic blocks.
block_last* Handle basic blocks.
curblock* Handle basic blocks.
dfo Barray!(*) Handle basic blocks.
startblock* Handle basic blocks.


MEM_PH_FREE mem_free Handle basic blocks.


Walter Bright


Boost License 1.0