org.jikesrvm.compilers.opt.ssa
Class LiveRangeSplitting.LiveRangeSplittingPhase

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.ssa.LiveRangeSplitting.LiveRangeSplittingPhase
Enclosing class:
LiveRangeSplitting

private static class LiveRangeSplitting.LiveRangeSplittingPhase
extends CompilerPhase


Nested Class Summary
private static class LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair
          A utility class to represent an edge in the CFG.
 
Field Summary
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
private LiveRangeSplitting.LiveRangeSplittingPhase()
           
 
Method Summary
private static void addEntriesForInfrequentBlocks(IR ir, LiveAnalysis live, HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> result)
          Split live ranges on entry and exit to infrequent regions.
private static HashSet<Register> findOrCreateSplitSet(HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> map, BasicBlock b1, BasicBlock b2)
          Given a mapping from BasicBlockPair -> HashSet, find or create the hash set corresponding to a given basic block pair
private static HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> findSplitPoints(IR ir, LiveAnalysis live, LSTGraph lst)
          Find the points the IR where live ranges should be split.
 String getName()
           
 CompilerPhase newExecution(IR ir)
          Return this instance of this phase.
 void perform(IR ir)
          This is the method that actually does the work of the phase.
 boolean shouldPerform(OptOptions options)
          This method determines if the phase should be run, based on the Options object it is passed.
private static void transform(IR ir, HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> xform)
          Perform the transformation
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiveRangeSplitting.LiveRangeSplittingPhase

private LiveRangeSplitting.LiveRangeSplittingPhase()
Method Detail

newExecution

public CompilerPhase newExecution(IR ir)
Return this instance of this phase. This phase contains no per-compilation instance fields.

Overrides:
newExecution in class CompilerPhase
Parameters:
ir - not used
Returns:
this

shouldPerform

public final boolean shouldPerform(OptOptions options)
Description copied from class: CompilerPhase
This method determines if the phase should be run, based on the Options object it is passed. By default, phases are always performed. Subclasses should override this method if they only want to be performed conditionally.

Overrides:
shouldPerform in class CompilerPhase
Parameters:
options - the compiler options for the compilation
Returns:
true if the phase should be performed

getName

public final String getName()
Specified by:
getName in class CompilerPhase
Returns:
a String which is the name of the phase.

perform

public final void perform(IR ir)
Description copied from class: CompilerPhase
This is the method that actually does the work of the phase.

Specified by:
perform in class CompilerPhase
Parameters:
ir - the IR on which to apply the phase

findSplitPoints

private static HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> findSplitPoints(IR ir,
                                                                                                                    LiveAnalysis live,
                                                                                                                    LSTGraph lst)
Find the points the IR where live ranges should be split.

Parameters:
ir - the governing IR
live - valid liveness information
lst - a valid loop structure tree
Returns:
the result as a mapping from BasicBlockPair to a set of registers

addEntriesForInfrequentBlocks

private static void addEntriesForInfrequentBlocks(IR ir,
                                                  LiveAnalysis live,
                                                  HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> result)
Split live ranges on entry and exit to infrequent regions. Add this information to 'result', a mapping from BasicBlockPair to a set of registers to split.

Parameters:
ir - the governing IR
live - valid liveness information
result - mapping from BasicBlockPair to a set of registers

findOrCreateSplitSet

private static HashSet<Register> findOrCreateSplitSet(HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> map,
                                                      BasicBlock b1,
                                                      BasicBlock b2)
Given a mapping from BasicBlockPair -> HashSet, find or create the hash set corresponding to a given basic block pair

Parameters:
map - the mapping to search
b1 - the first basic block in the pair
b2 - the second basic block in the pair

transform

private static void transform(IR ir,
                              HashMap<LiveRangeSplitting.LiveRangeSplittingPhase.BasicBlockPair,HashSet<Register>> xform)
Perform the transformation

Parameters:
ir - the governing IR
xform - a mapping from BasicBlockPair to the set of registers to split