Documentation ¶
Overview ¶
Package taufunc defines a transformation pass to remove τ functions.
τ functions are functions where the bodies are empty or just τ-actions. The transformation algorithm is as follows:
Build control flow graph of given program Foreach function: Mark τ if function body does not contain non control flow primitives Repeat until no changes: Foreach non-τ function: If CFG parent is τ: Mark parent non-τ Remove all function definitions marked as τ
Whether a primitive is considered a τ or not is defined by the isTau method.
Usage ¶
To remove all tau functions:
taufunc.Find(prog, taufunc.Remove)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
func Find(prog *migo.Program, visitTauFn func(fn *migo.Function) bool)
Find finds function definitions from Program prog if its body is reducible to tau (no communication).
visitTauFn is then applied to each functions found, the return value indicates if fn should be removed.
If fn is marked remove, prog will be updated accordingly.
func Remove ¶
func Remove(taufn *migo.Function) (remove bool)
Remove marks taufn to be removed from its parent Program.
func RemoveExcept ¶
func RemoveExcept(exceptfn *migo.Function) func(taufn *migo.Function) (remove bool)
RemoveExcept returns a custom RemoveAll function that marks taufn to be removed unless taufn is exceptfn (an exception).
Types ¶
This section is empty.