CompilerTools.Loops

Exported


CompilerTools.Loops.DomLoops

A type that holds information about which basic blocks dominate which other blocks. It also contains an array "loops" of all the loops discovered within the function. The same basic block may occur as a member in multiple loop entries if those loops are nested. This module doesn't currently help identify these nesting levels but by looking at loop members it is easy enough to figure out.

source: CompilerTools/src/loops.jl:59


CompilerTools.Loops.Loop

A type to hold information about a loop. A loop has a "head" that dominates all the other blocks in the loop. A loop has a back_edge which is a block that has "head" as one of its successors. It also contains "members" which is a set of basic block labels of all the basic blocks that are a part of this loop.

source: CompilerTools/src/loops.jl:43

Internal


compute_dom_loops(bl::CompilerTools.CFGs.CFG)

Find the loops in a CFGs.CFG in "bl".

source: CompilerTools/src/loops.jl:211


findLoopInvariants(l::CompilerTools.Loops.Loop, udinfo::Dict{CompilerTools.LivenessAnalysis.BasicBlock, CompilerTools.UDChains.UDInfo}, bl::CompilerTools.LivenessAnalysis.BlockLiveness)

Finds those computations within a loop that are iteration invariant. Takes as input: l - the Loop to find invariants in udinfo - UDChains (use-definition chains) for the basic blocks of the function. bl - LivenessAnalysis.BlockLiveness with liveness information for variables within the function.

source: CompilerTools/src/loops.jl:86


findLoopMembers(head, back_edge, bbs)

Find all the members of the loop as specified by the "head" basic block and the "back_edge" basic block. Also takes the dictionary of labels to basic blocks. Start with just the head of the loop as a member and then starts recursing with the back_edge using flm_internal.

source: CompilerTools/src/loops.jl:205


flm_internal(cur_bb, members, bbs)

Add to the "members" of the loop being accumulated given "cur_bb" which is known to be a member of the loop.

source: CompilerTools/src/loops.jl:183


isInLoop(dl::CompilerTools.Loops.DomLoops, bb::Int64)

Takes a DomLoops object containing loop information about the function. Returns true if the given basic block label "bb" is in some loop in the function.

source: CompilerTools/src/loops.jl:66