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

Compiler implementation of the D programming language.

Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/blockopt.d

Functions

NameDescription
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_check() Check integrity of 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_goto() Goto a block named gotolbl. Start a new block that is labelled by newlbl.
block_init() Handle basic blocks.
block_initvar(s) Mark curblock as initializing Symbol s.
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. Also compute numblks and maxblks.
block_term() Handle basic blocks.
block_visit(b) Visit block and each of its predecessors.
blocklist_dehydrate(pb) Hydrate/dehydrate a list of blocks.
blocklist_free(pb) Free list of blocks.
blocklist_hydrate(pb) Hydrate/dehydrate a 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.
util_realloc(p, n, size) Handle basic blocks.

Manifest constants

NameTypeDescription
SCPP_OR_NTEXCEPTIONS Handle basic blocks.

Global variables

NameTypeDescription
bc_goal uint[20] Handle basic blocks.
blkzero dmd.backend.cc.block Handle basic blocks.
block_freelist dmd.backend.cc.block* Handle basic blocks.
block_last dmd.backend.cc.block* Handle basic blocks.
curblock dmd.backend.cc.block* Handle basic blocks.
dfo Barray!(dmd.backend.cc.block*) Handle basic blocks.
numblks uint Handle basic blocks.
startblock dmd.backend.cc.block* Handle basic blocks.

Aliases

NameTypeDescription
MEM_PH_FREE Handle basic blocks.

Authors

Walter Bright

License

Boost License 1.0