Class InductionVarAnalyzer
java.lang.Object
EDU.purdue.cs.bloat.diva.InductionVarAnalyzer
InductionVarAnalyzer traverses a control flow graph and looks for array
element swizzle operations inside loops. If possible, these swizzle
operations are hoisted out of the loop and are replaced with range swizzle
operations. The technique used is Demand-driven Induction Variable Analysis
(DIVA).
To accomplish its tasks, InductionVarAnalyzer keeps track of a number of induction variables (represented by Swizzler objects) and local variables.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDisplays (to System.out) all of the Swizzlers stored in the induction variable store.voiddisplaySwizzler(Swizzler indswz) Displays the contents of a Swizzler object to System.out.get_local(int vn) Searchs the stored list of local variables for a local variable with a given value number.get_swizzler(int vn) Searches the list of induction variables for an induction variable with a given value number.voidinsert_aswrange(Swizzler indswz) Adds a swizzle range statement (SRStmt) to the end of each predacessor block of the block containing the phi statement that defines an induction variable provided that the phi block does not dominate its predacessor.isMu(PhiJoinStmt phi, FlowGraph cfg) Determines whether or not a phi statement is a mu function.voidPerforms DIVA on a CFG.
-
Field Details
-
DEBUG
public static boolean DEBUG
-
-
Constructor Details
-
InductionVarAnalyzer
public InductionVarAnalyzer()
-
-
Method Details
-
get_swizzler
Searches the list of induction variables for an induction variable with a given value number.- Parameters:
vn- Value number to search for.- Returns:
- Swizzler object whose target has the desired value number or null, if value number is not found.
-
get_local
Searchs the stored list of local variables for a local variable with a given value number.- Parameters:
vn- The value number to search for.- Returns:
- The local variable with the given value number, or null, if not found.
-
Display_store
public void Display_store()Displays (to System.out) all of the Swizzlers stored in the induction variable store.- See Also:
-
displaySwizzler
Displays the contents of a Swizzler object to System.out.- Parameters:
indswz- The Swizzler to display.
-
insert_aswrange
Adds a swizzle range statement (SRStmt) to the end of each predacessor block of the block containing the phi statement that defines an induction variable provided that the phi block does not dominate its predacessor. Phew.- Parameters:
indswz- Swizzler representing the induction variable on which the range swizzle statement is added.
-
isMu
Determines whether or not a phi statement is a mu function. A mu function is a phi function that merges values at loop headers, as opposed to those that occur as a result of forward branching. Mu functions always have two arguments.- Parameters:
phi- phi statement that may be a mu functioncfg- CFG to look through Get rid of this parameter- Returns:
- The block containing the mu functions external (that is, outside the loop) argument, also known as the external ssalink. If the phi statement is not a mu function, null is returned.
-
transform
Performs DIVA on a CFG.
-