public final class SchedulePhase extends Phase
Modifier and Type | Class and Description |
---|---|
static class |
SchedulePhase.SchedulingError
Error thrown when a graph cannot be scheduled.
|
static class |
SchedulePhase.SchedulingStrategy |
Modifier and Type | Field and Description |
---|---|
private BlockMap<LocationSet> |
blockToKillSet |
private BlockMap<List<Node>> |
blockToNodesMap
Map from blocks to the nodes in each block.
|
private ControlFlowGraph |
cfg |
private NodeMap<Block> |
nodeToBlockMap |
private SchedulePhase.SchedulingStrategy |
selectedStrategy |
BEFORE_PHASE_DUMP_LEVEL, PHASE_DUMP_LEVEL
Constructor and Description |
---|
SchedulePhase() |
SchedulePhase(SchedulePhase.SchedulingStrategy strategy) |
Modifier and Type | Method and Description |
---|---|
private static void |
addNode(BlockMap<List<Node>> blockToNodes,
Block b,
Node endNode) |
private static Block |
adjustLatestForRead(FloatingReadNode floatingReadNode,
Block earliestBlock,
Block latestBlock,
LocationIdentity location) |
private static Block |
calcBlockForUsage(Node node,
Node usage,
Block startCurrentBlock,
NodeMap<Block> currentNodeMap) |
private static Block |
calcLatestBlock(Block earliestBlock,
boolean scheduleOutOfLoops,
Node currentNode,
NodeMap<Block> currentNodeMap) |
private BlockMap<ArrayList<FloatingReadNode>> |
calcLatestBlocks(boolean isOutOfLoops,
NodeMap<Block> currentNodeMap,
BlockMap<List<Node>> earliestBlockToNodesMap,
NodeBitMap visited,
BlockMap<List<Node>> latestBlockToNodesMap) |
private static boolean |
checkLatestEarliestRelation(Node currentNode,
Block earliestBlock,
Block latestBlock) |
private static void |
checkWatchList(ArrayList<FloatingReadNode> watchList,
LocationIdentity identity,
Block b,
ArrayList<Node> result,
NodeMap<Block> nodeMap,
NodeBitMap unprocessed) |
private static void |
checkWatchList(Block b,
NodeMap<Block> nodeMap,
NodeBitMap unprocessed,
ArrayList<Node> result,
ArrayList<FloatingReadNode> watchList,
Node n) |
private static void |
fillKillSet(LocationSet killed,
List<Node> subList) |
BlockMap<List<Node>> |
getBlockToNodesMap()
Gets the map from each block to the nodes in the block.
|
ControlFlowGraph |
getCFG() |
NodeMap<Block> |
getNodeToBlockMap() |
private static boolean |
isFixedEnd(FixedNode endNode) |
List<Node> |
nodesFor(Block block)
Gets the nodes in a given block.
|
private static void |
printNode(Node n) |
String |
printScheduleHelper(String desc) |
private static void |
processStack(ControlFlowGraph cfg,
BlockMap<List<Node>> blockToNodes,
NodeMap<Block> nodeToBlock,
NodeBitMap visited,
BitSet floatingReads,
NodeStack stack) |
private static void |
resortEarliestWithinBlock(Block b,
BlockMap<List<Node>> blockToNodes,
NodeMap<Block> nodeToBlock,
NodeBitMap unprocessed) |
protected void |
run(StructuredGraph graph) |
private static void |
scheduleEarliestIterative(ControlFlowGraph cfg,
BlockMap<List<Node>> blockToNodes,
NodeMap<Block> nodeToBlock,
NodeBitMap visited,
StructuredGraph graph) |
private static void |
sortIntoList(Node n,
Block b,
ArrayList<Node> result,
NodeMap<Block> nodeMap,
NodeBitMap unprocessed,
Node excludeNode) |
private static void |
sortNodesLatestWithinBlock(Block b,
BlockMap<List<Node>> earliestBlockToNodesMap,
BlockMap<List<Node>> latestBlockToNodesMap,
NodeMap<Block> nodeMap,
BlockMap<ArrayList<FloatingReadNode>> watchListMap,
NodeBitMap unprocessed) |
private static void |
sortNodesLatestWithinBlock(ControlFlowGraph cfg,
BlockMap<List<Node>> earliestBlockToNodesMap,
BlockMap<List<Node>> latestBlockToNodesMap,
NodeMap<Block> currentNodeMap,
BlockMap<ArrayList<FloatingReadNode>> watchListMap,
NodeBitMap visited) |
private static boolean |
verifySchedule(ControlFlowGraph cfg,
BlockMap<List<Node>> blockToNodesMap,
NodeMap<Block> nodeMap) |
apply, apply, createName, getName
private ControlFlowGraph cfg
private BlockMap<List<Node>> blockToNodesMap
private BlockMap<LocationSet> blockToKillSet
private final SchedulePhase.SchedulingStrategy selectedStrategy
private NodeMap<Block> nodeToBlockMap
public SchedulePhase()
public SchedulePhase(SchedulePhase.SchedulingStrategy strategy)
protected void run(StructuredGraph graph)
private BlockMap<ArrayList<FloatingReadNode>> calcLatestBlocks(boolean isOutOfLoops, NodeMap<Block> currentNodeMap, BlockMap<List<Node>> earliestBlockToNodesMap, NodeBitMap visited, BlockMap<List<Node>> latestBlockToNodesMap)
private static boolean checkLatestEarliestRelation(Node currentNode, Block earliestBlock, Block latestBlock)
private static boolean verifySchedule(ControlFlowGraph cfg, BlockMap<List<Node>> blockToNodesMap, NodeMap<Block> nodeMap)
private static Block adjustLatestForRead(FloatingReadNode floatingReadNode, Block earliestBlock, Block latestBlock, LocationIdentity location)
private static void fillKillSet(LocationSet killed, List<Node> subList)
private static void sortNodesLatestWithinBlock(ControlFlowGraph cfg, BlockMap<List<Node>> earliestBlockToNodesMap, BlockMap<List<Node>> latestBlockToNodesMap, NodeMap<Block> currentNodeMap, BlockMap<ArrayList<FloatingReadNode>> watchListMap, NodeBitMap visited)
private static void sortNodesLatestWithinBlock(Block b, BlockMap<List<Node>> earliestBlockToNodesMap, BlockMap<List<Node>> latestBlockToNodesMap, NodeMap<Block> nodeMap, BlockMap<ArrayList<FloatingReadNode>> watchListMap, NodeBitMap unprocessed)
private static void checkWatchList(Block b, NodeMap<Block> nodeMap, NodeBitMap unprocessed, ArrayList<Node> result, ArrayList<FloatingReadNode> watchList, Node n)
private static void checkWatchList(ArrayList<FloatingReadNode> watchList, LocationIdentity identity, Block b, ArrayList<Node> result, NodeMap<Block> nodeMap, NodeBitMap unprocessed)
private static void sortIntoList(Node n, Block b, ArrayList<Node> result, NodeMap<Block> nodeMap, NodeBitMap unprocessed, Node excludeNode)
private static Block calcLatestBlock(Block earliestBlock, boolean scheduleOutOfLoops, Node currentNode, NodeMap<Block> currentNodeMap)
private static Block calcBlockForUsage(Node node, Node usage, Block startCurrentBlock, NodeMap<Block> currentNodeMap)
private static void scheduleEarliestIterative(ControlFlowGraph cfg, BlockMap<List<Node>> blockToNodes, NodeMap<Block> nodeToBlock, NodeBitMap visited, StructuredGraph graph)
private static boolean isFixedEnd(FixedNode endNode)
private static void resortEarliestWithinBlock(Block b, BlockMap<List<Node>> blockToNodes, NodeMap<Block> nodeToBlock, NodeBitMap unprocessed)
private static void processStack(ControlFlowGraph cfg, BlockMap<List<Node>> blockToNodes, NodeMap<Block> nodeToBlock, NodeBitMap visited, BitSet floatingReads, NodeStack stack)
public String printScheduleHelper(String desc)
public ControlFlowGraph getCFG()
public BlockMap<List<Node>> getBlockToNodesMap()
public NodeMap<Block> getNodeToBlockMap()