ic.opt
Class Optimization
java.lang.Object
ic.opt.Optimization
public abstract class Optimization
- extends Object
To create an optimization, simply subclass this class and define
optimize(md) to compute any dataflow information necessary to
perform the optimization on md and then modify the method's TAC
list. You can either provide methods in your TACList class to
modify an existing list, or you can construct a new list to replace
the old one.
The methods return true to indicate that the optimization changed
the TAC in some way. While not required, you can provide a -iter
command-line option that iterative applies all optimizations over
and over again until no additional changes happen.
Method Summary |
abstract boolean |
optimize(ic.ast.MethodDecl md)
Apply the optimization to the method md. |
boolean |
optimize(ic.ast.Program p)
Apply the optimization to each Method in p. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Optimization
public Optimization()
optimize
public boolean optimize(ic.ast.Program p)
- Apply the optimization to each Method in p.
Return true if the TAC for any of them changed.
optimize
public abstract boolean optimize(ic.ast.MethodDecl md)
- Apply the optimization to the method md.
Return true if the TAC for the method changes
at all.