public class LoopUnrolling extends CompilerPhase
Modifier and Type | Class and Description |
---|---|
(package private) class |
LoopUnrolling.RealDefs |
Modifier and Type | Field and Description |
---|---|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase
|
private Map<BasicBlock,BasicBlock> |
copiedBlocks |
(package private) static boolean |
DEBUG |
(package private) static int |
MAX_BLOCKS_FOR_NAIVE_UNROLLING |
(package private) static int |
MaxInstructions |
private int |
theVisit |
private int |
unrollFactor |
private Map<Instruction,Integer> |
visitInts |
container
Constructor and Description |
---|
LoopUnrolling() |
Modifier and Type | Method and Description |
---|---|
private Operand |
_follow(Operand use) |
private void |
_printDefs(Operand op) |
(package private) BasicBlock |
copyAndLinkBlock(IR ir,
BasicBlock seqLast,
BasicBlock block) |
private static Instruction |
definingInstruction(Operand op) |
(package private) static void |
deleteBranches(BasicBlock b) |
private Operand |
follow(Operand use) |
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase
|
String |
getName()
Returns the name of the phase.
|
private static boolean |
loopInvariant(Operand op,
BitVector nloop,
int depth) |
(package private) BasicBlock[] |
makeSomeCopies(int unrollFactor,
IR ir,
BitVector nloop,
int blocks,
BasicBlock header,
BasicBlock exitBlock,
BasicBlock seqStart) |
private void |
naiveUnroller(LSTNode t,
IR ir) |
void |
perform(IR ir)
This is the method that actually does the work of the phase.
|
private static boolean |
printDefs(Operand op,
BitVector nloop,
int depth) |
(package private) static void |
report(String s) |
boolean |
shouldPerform(OptOptions options)
This phase is disabled by default.
|
(package private) boolean |
unrollLeaf(LSTNode t,
IR ir) |
(package private) void |
unrollLoops(IR ir) |
(package private) int |
unrollLoopTree(LSTNode t,
IR ir,
int target) |
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
static final boolean DEBUG
static final int MAX_BLOCKS_FOR_NAIVE_UNROLLING
private final Map<BasicBlock,BasicBlock> copiedBlocks
private int theVisit
private Map<Instruction,Integer> visitInts
private static final Constructor<CompilerPhase> constructor
static final int MaxInstructions
private int unrollFactor
public LoopUnrolling()
public String getName()
getName
in class CompilerPhase
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public boolean shouldPerform(OptOptions options)
It will run only on O3 but O2 is the default maximum optimization level.
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationpublic void perform(IR ir)
CompilerPhase
perform
in class CompilerPhase
ir
- the IR on which to apply the phasevoid unrollLoops(IR ir)
int unrollLoopTree(LSTNode t, IR ir, int target)
boolean unrollLeaf(LSTNode t, IR ir)
private void naiveUnroller(LSTNode t, IR ir)
private static Instruction definingInstruction(Operand op)
private static boolean loopInvariant(Operand op, BitVector nloop, int depth)
private void _printDefs(Operand op)
BasicBlock[] makeSomeCopies(int unrollFactor, IR ir, BitVector nloop, int blocks, BasicBlock header, BasicBlock exitBlock, BasicBlock seqStart)
BasicBlock copyAndLinkBlock(IR ir, BasicBlock seqLast, BasicBlock block)
static void deleteBranches(BasicBlock b)