CompilerTools.LivenessAnalysis

Exported


find_bb_for_statement(top_number::Int64, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Search for a basic block containing a statement with the given top-level number in the liveness information. Returns a basic block label of a block having that top-level number or "nothing" if no such statement could be found.

source: CompilerTools/src/liveness.jl:421


show(io::IO, bb::CompilerTools.LivenessAnalysis.BasicBlock)

Overload of Base.show to pretty-print a LivenessAnalysis.BasicBlock.

source: CompilerTools/src/liveness.jl:137


show(io::IO, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Overload of Base.show to pretty-print BlockLiveness type.

source: CompilerTools/src/liveness.jl:375


show(io::IO, tls::CompilerTools.LivenessAnalysis.TopLevelStatement)

Overload of Base.show to pretty-print a LivenessAnalysis.TopLevelStatement.

source: CompilerTools/src/liveness.jl:76


CompilerTools.LivenessAnalysis.BlockLiveness

The main return type from LivenessAnalysis. Contains a dictionary that maps CFG basic block to liveness basic blocks. Also contains the corresponding CFG.

source: CompilerTools/src/liveness.jl:281

Internal


TypedExpr(typ, rest...)

Convenience function to create an Expr and make sure the type is filled in as well. The first arg is the type of the Expr and the rest of the args are the constructors args to Expr.

source: CompilerTools/src/liveness.jl:43


addUnmodifiedParams(func, signature::Array{DataType, 1}, unmodifieds, state::CompilerTools.LivenessAnalysis.expr_state)

Add an entry the dictionary of which arguments can be modified by which functions.

source: CompilerTools/src/liveness.jl:617


add_access(bb, sym, read)

Called when AST traversal finds some Symbol "sym" in a basic block "bb". "read" is true if the symbol is being used and false if it is being defined.

source: CompilerTools/src/liveness.jl:191


compute_live_ranges(state::CompilerTools.LivenessAnalysis.expr_state, dfn)

Compute the live_in and live_out information for each basic block and statement.

source: CompilerTools/src/liveness.jl:458


countSymbolDefs(s, lives)

Count the number of times that the symbol in "s" is defined in all the basic blocks.

source: CompilerTools/src/liveness.jl:863


create_unmodified_args_dict()

Convert the function_descriptions table into a dictionary that can be passed to LivenessAnalysis to indicate which args are unmodified by which functions.

source: CompilerTools/src/function-descriptions.jl:257


def(x, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Get the def information for "x" where x can be a liveness or CFG basic block or a liveness or CFG statement.

source: CompilerTools/src/liveness.jl:361


dump_bb(bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Dump a bunch of debugging information about BlockLiveness.

source: CompilerTools/src/liveness.jl:527


find_top_number(top_number::Int64, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Search for a statement with the given top-level number in the liveness information. Returns a LivenessAnalysis.TopLevelStatement having that top-level number or "nothing" if no such statement could be found.

source: CompilerTools/src/liveness.jl:402


fromCFG(live_res, cfg::CompilerTools.CFGs.CFG, callback::Function, cbdata::ANY)

Extract liveness information from the CFG.

source: CompilerTools/src/liveness.jl:904


from_assignment(ast::Array{Any, 1}, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Walk through an assignment expression.

source: CompilerTools/src/liveness.jl:592


from_call(ast::Array{Any, 1}, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Walk through a call expression.

source: CompilerTools/src/liveness.jl:806


from_expr(ast::Expr)

This function gives you the option of calling the ENTRY point from_expr with an ast and several optional named arguments.

source: CompilerTools/src/liveness.jl:897


from_expr(ast::Expr, callback)

ENTRY point to liveness analysis. You must pass a :lambda Expr as "ast". If you have non-standard AST nodes, you may pass a callback that will be given a chance to process the non-standard node first.

source: CompilerTools/src/liveness.jl:885


from_expr(ast::Expr, callback, cbdata::ANY)

ENTRY point to liveness analysis. You must pass a :lambda Expr as "ast". If you have non-standard AST nodes, you may pass a callback that will be given a chance to process the non-standard node first.

source: CompilerTools/src/liveness.jl:885


from_expr(ast::Expr, callback, cbdata::ANY, no_mod)

ENTRY point to liveness analysis. You must pass a :lambda Expr as "ast". If you have non-standard AST nodes, you may pass a callback that will be given a chance to process the non-standard node first.

source: CompilerTools/src/liveness.jl:885


from_expr(ast::LambdaStaticData, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Generic routine for how to walk most AST node types.

source: CompilerTools/src/liveness.jl:958


from_exprs(ast::Array{Any, 1}, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Walk through an array of expressions. Just recursively call from_expr for each expression in the array.

source: CompilerTools/src/liveness.jl:578


from_if(args, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Process a gotoifnot which is just a recursive processing of its first arg which is the conditional.

source: CompilerTools/src/liveness.jl:944


from_lambda(ast::Expr, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Walk through a lambda expression. We just need to extract the ref_params because liveness needs to keep those ref_params live at the end of the function. We don't recurse into the body here because from_expr handles that with fromCFG.

source: CompilerTools/src/liveness.jl:568


from_return(args, depth::Int64, state::CompilerTools.LivenessAnalysis.expr_state, callback::Function, cbdata::ANY)

Process a return Expr node which is just a recursive processing of all of its args.

source: CompilerTools/src/liveness.jl:935


getUnmodifiedArgs(func::ANY, args, arg_type_tuple::Array{DataType, 1}, state::CompilerTools.LivenessAnalysis.expr_state)

For a given function and signature, return which parameters can be modified by the function. If we have cached this information previously then return that, else cache the information for some well-known functions or default to presuming that all arguments could be modified.

source: CompilerTools/src/liveness.jl:733


get_function_from_string(mod::AbstractString, func::AbstractString)

Takes a module and a function both as Strings. Looks up the specified module as part of the "Main" module and then looks and returns the Function object corresponding to the "func" String in that module.

source: CompilerTools/src/function-descriptions.jl:239


get_info_internal(x::Union{CompilerTools.LivenessAnalysis.BasicBlock, CompilerTools.LivenessAnalysis.TopLevelStatement}, bl::CompilerTools.LivenessAnalysis.BlockLiveness, field)

The live_in, live_out, def, and use routines are all effectively the same but just extract a different field name. Here we extract this common behavior where x can be a liveness or CFG basic block or a liveness or CFG statement. bl is BlockLiveness type as returned by a previous LivenessAnalysis. field is the name of the field requested.

source: CompilerTools/src/liveness.jl:323


isDef(x::Union{GenSym, Symbol}, live_info)

Query if the symbol in argument "x" is defined in live_info which can be a BasicBlock or TopLevelStatement.

source: CompilerTools/src/liveness.jl:393


isPassedByRef(x, state::CompilerTools.LivenessAnalysis.expr_state)

Returns true if a parameter is passed by reference. isbits types are not passed by ref but everything else is (is this always true..any exceptions?)

source: CompilerTools/src/liveness.jl:665


live_in(x, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Get the live_in information for "x" where x can be a liveness or CFG basic block or a liveness or CFG statement.

source: CompilerTools/src/liveness.jl:347


live_out(x, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Get the live_out information for "x" where x can be a liveness or CFG basic block or a liveness or CFG statement.

source: CompilerTools/src/liveness.jl:354


not_handled(a, b)

The default callback that processes no non-standard Julia AST nodes.

source: CompilerTools/src/liveness.jl:856


recompute_live_ranges(state, dfn)

Clear the live_in and live_out data corresponding to all basic blocks and statements and then recompute liveness information.

source: CompilerTools/src/liveness.jl:440


typeOfOpr(x::ANY, li::CompilerTools.LambdaHandling.LambdaInfo)

Get the type of some AST node.

source: CompilerTools/src/liveness.jl:624


uncompressed_ast(l::LambdaStaticData)

Convert a compressed LambdaStaticData format into the uncompressed AST format.

source: CompilerTools/src/liveness.jl:558


use(x, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Get the use information for "x" where x can be a liveness or CFG basic block or a liveness or CFG statement.

source: CompilerTools/src/liveness.jl:368


CompilerTools.LivenessAnalysis.AccessSummary

Sometimes if new AST nodes are introduced then we need to ask for their def and use set as a whole and then incorporate that into our liveness analysis directly.

source: CompilerTools/src/liveness.jl:111


CompilerTools.LivenessAnalysis.BasicBlock

Liveness information for a BasicBlock. Contains a pointer to the corresponding CFG BasicBlock. Contains def, use, live_in, and live_out for this basic block. Contains an array of liveness information for the top level statements in this block.

source: CompilerTools/src/liveness.jl:124


CompilerTools.LivenessAnalysis.TopLevelStatement

Liveness information for a TopLevelStatement in the CFG. Contains a pointer to the corresponding CFG TopLevelStatement. Contains def, use, live_in, and live_out for the current statement.

source: CompilerTools/src/liveness.jl:64


CompilerTools.LivenessAnalysis.expr_state

Holds the state during the AST traversal. cfg = the control flow graph from the CFGs module. map = our own map of CFG basic blocks to our own basic block information with liveness in it. cur_bb = the current basic block in which we are processing AST nodes. read = whether the sub-tree we are currently processing is being read or written. ref_params = those arguments to the function that are passed by reference.

source: CompilerTools/src/liveness.jl:265