org.jikesrvm.compilers.opt.ssa
Class RedundantBranchElimination

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.OptimizationPlanElement
      extended by org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement
          extended by org.jikesrvm.compilers.opt.ssa.RedundantBranchElimination

public final class RedundantBranchElimination
extends OptimizationPlanCompositeElement

Redundant branch elimination based on SSA form, global value numbers, and dominance relationships. The following are sufficient conditions for a conditional branch cb1 to be eliminated as redundant

NOTE: the check for exactly one in edge is used to rule out situations like the following:
      if (C) goto L2              // cb2
      x = x + 1;
  L2: x = x + 1;
      if (C) goto L3.            // cb1
 
Consider redundant branch elimination for cb1. Here L2 (the target of cb2) dominates cb1, but it is not correct to eliminate cb1 because it is also reachable (but not dominated) from the continuation block of cb2!


Nested Class Summary
private static class RedundantBranchElimination.EnsureSSA
           
private static class RedundantBranchElimination.RBE
           
 
Constructor Summary
RedundantBranchElimination()
          Create this phase element as a composite of other elements
 
Method Summary
 boolean shouldPerform(OptOptions options)
          Determine, possibly by consulting the passed options object, if this optimization plan element should be performed.
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement
compose, elapsedTime, getName, initializeForMeasureCompilation, perform, printingEnabled, reportStats
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.OptimizationPlanElement
prettyPrintTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedundantBranchElimination

public RedundantBranchElimination()
Create this phase element as a composite of other elements

Method Detail

shouldPerform

public boolean shouldPerform(OptOptions options)
Description copied from class: OptimizationPlanElement
Determine, possibly by consulting the passed options object, if this optimization plan element should be performed.

Overrides:
shouldPerform in class OptimizationPlanCompositeElement
Parameters:
options - The Options object for the current compilation.
Returns:
true if the plan element should be performed.