coins.opt
Class LoopUnswitching

java.lang.Object
  extended bycoins.opt.LoopExpansion
      extended bycoins.opt.LoopUnswitching

public class LoopUnswitching
extends LoopExpansion

title: LoopUnswitching class.

description: If-Expand LoopStmt.


Field Summary
 
Fields inherited from class coins.opt.LoopExpansion
fDbgLevel, flowRoot, fMaxAllowableNodesInLoopBody, fNumberOfGeneralRegisters, fOptionMap, fOptions, hirRoot, ioRoot, symRoot
 
Constructor Summary
LoopUnswitching(HirRoot phirRoot)
           
 
Method Summary
 boolean doSubprogram(SubpDefinition pSubpDef)
          Do Loop-If Expand optimization in subprogram.
protected  boolean isExpansible(ForStmt pForStmt)
          Check ForStmt may be optimized by Loop-if expansion.
protected  void pickUpVariables(ForStmt pForStmt)
          Analize variables in ForStmt contains to get information to doing Loop-If expanding optimization.
protected  boolean removeIfStmt(ForStmt pForStmt)
          Remove IfStmt from pForStmt
 
Methods inherited from class coins.opt.LoopExpansion
calcStatementCount, getArrayVar, getDebug, getMaxAllowableStmtsInLoopBody, getSimpleExp, getSubscriptVar, hasBadElement, isBadElement, setMaxAllowableStmtsInLoopBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoopUnswitching

public LoopUnswitching(HirRoot phirRoot)
Method Detail

doSubprogram

public boolean doSubprogram(SubpDefinition pSubpDef)
Do Loop-If Expand optimization in subprogram.

Specified by:
doSubprogram in class LoopExpansion
Parameters:
pSubpDef - SubpDefinition to do optimization.
Returns:
true if optimized, false if else.

isExpansible

protected boolean isExpansible(ForStmt pForStmt)
Check ForStmt may be optimized by Loop-if expansion.

Parameters:
pForStmt -
Returns:
true pForStmt may be optimized by Loop-if expansion. false pForStmt is not optimized by Loop-if expansion.

pickUpVariables

protected void pickUpVariables(ForStmt pForStmt)
Analize variables in ForStmt contains to get information to doing Loop-If expanding optimization.

Parameters:
pForStmt - ForStmt to analize.

removeIfStmt

protected boolean removeIfStmt(ForStmt pForStmt)
Remove IfStmt from pForStmt

Parameters:
pForStmt - ForStmt object.
Returns:
true if optimized, false if else.