| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.score.trans.Optimization
scale.score.trans.ValNum
public class ValNum
Global value numbering optimization.
$Id: ValNum.java,v 1.100 2007-10-04 19:58:38 burrill Exp $
 Copyright 2008 by the
 Scale Compiler Group, 
 Global value numbering based on the dominator-based value numbering
 technique by Preston Briggs et al, "Value Numbering", Software --
 Practice and Experience, 1990.
  
 Global value numbering is essentially a common subexpression.
 elimination algorithm.  It attempts to find multiple occurrences of
 the same expression and replace the subsequent ones with a
 reference to a new variable whose value is obtained from the first
 occrrence and are dominated by the first occurrence.
  
 If the first occurrence of the expression is assigned to a
 variable, this optimization will attempt to use that variable as
 the replacement variable.
  
 It is possible, though unlikely, for a transformation to reduce
 register pressure.  If the expression references more than one
 variable that are referenced nowhere else in the scope of the def
 of the replacement variable, register pressure will be reduced.  If
 there is more than one variable that is referenced in other
 expressions, register pressure will increase.
  
 A transformation is 
 Department of Computer Science
 University of Massachusetts
 Amherst MA. 01003, USA
 All Rights Reserved.
 legal if:
 
 
It is
 
volatile,
 beneficial if:
 
| Field Summary | |
|---|---|
| static boolean | classTraceTrue if traces are to be performed. | 
| static boolean | useHeuristicsIf true, use heuristics that prune the cases where the optimization is applied. | 
| Fields inherited from class scale.score.trans.Optimization | 
|---|
| dChanged, fpReorder, hasDummyAliases, IN_SSA, minimumExecutionCost, NA_SSA, NO_SSA, rChanged, scribble, signedIntsWrapOnOverflow, trace, un, unsafe, unsignedIntsWrapOnOverflow, VALID_SSA | 
| Constructor Summary | |
|---|---|
| ValNum(Scribble scribble) | |
| Method Summary | |
|---|---|
| static int | deadCFGNodes()Return the number of dead nodes removed. | 
| static int | newCFGNodes()Return the number of new nodes added. | 
|  void | perform()Go through dominance tree to do value numbering. | 
| static int | propagations()Return the number of expressions removed. | 
| Methods inherited from class scale.score.trans.Optimization | 
|---|
| assertTrace, assertTrace, assertTrace, assertTrace, assertTrace, genTemp, insertStores, requiresSSA, setTrace, sort | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static boolean classTrace
public static boolean useHeuristics
| Constructor Detail | 
|---|
public ValNum(Scribble scribble)
| Method Detail | 
|---|
public static int deadCFGNodes()
public static int newCFGNodes()
public static int propagations()
public void perform()
    a1 = b1 + c1
 
 the value number of b1+c1 is a1. An exception
 ocurrs when the left hand side has alias varibles. In this case,
 we create a new variable `for the right hand expression.
perform in class Optimization| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||