Class AbstractSSAConversion

java.lang.Object
com.ibm.wala.cast.ir.ssa.AbstractSSAConversion
Direct Known Subclasses:
SSAConversion

public abstract class AbstractSSAConversion extends Object
Abstract core of traditional SSA conversion (Cytron et al.).

This implementation is abstract in the sense that it is designed to work over the instructions and CFG of a Domo IR, but it is abstract with respect to several integral portions of the traditional algorithm:

  • The notion of uses and defs of a given instruction.
  • Assignments (<def> := <use>) that are be copy-propagated away
  • Which values are constants---i.e. have no definition.
  • Any value numbers to be skipped during SSA construction
  • Special initialization and exit block processing.
Author:
Julian dolby (dolby@us.ibm.com)
  • Field Details

  • Constructor Details

    • AbstractSSAConversion

      protected AbstractSSAConversion(IR ir, SSAOptions options)
  • Method Details

    • getNumberOfDefs

      protected abstract int getNumberOfDefs(SSAInstruction inst)
    • getDef

      protected abstract int getDef(SSAInstruction inst, int index)
    • getNumberOfUses

      protected abstract int getNumberOfUses(SSAInstruction inst)
    • getUse

      protected abstract int getUse(SSAInstruction inst, int index)
    • isAssignInstruction

      protected abstract boolean isAssignInstruction(SSAInstruction inst)
    • getMaxValueNumber

      protected abstract int getMaxValueNumber()
    • isLive

      protected abstract boolean isLive(SSACFG.BasicBlock Y, int V)
    • skip

      protected abstract boolean skip(int vn)
    • isConstant

      protected abstract boolean isConstant(int valueNumber)
    • getNextNewValueNumber

      protected abstract int getNextNewValueNumber()
    • initializeVariables

      protected abstract void initializeVariables()
    • repairExit

      protected abstract void repairExit()
    • placeNewPhiAt

      protected abstract void placeNewPhiAt(int value, SSACFG.BasicBlock Y)
    • getPhi

      protected abstract SSAPhiInstruction getPhi(SSACFG.BasicBlock B, int index)
    • setPhi

      protected abstract void setPhi(SSACFG.BasicBlock B, int index, SSAPhiInstruction inst)
    • repairPhiDefs

      protected abstract SSAPhiInstruction repairPhiDefs(SSAPhiInstruction phi, int[] newDefs)
    • repairPhiUse

      protected abstract void repairPhiUse(SSACFG.BasicBlock BB, int phiIndex, int rvalIndex, int newRval)
    • repairInstructionUses

      protected abstract void repairInstructionUses(SSAInstruction inst, int index, int[] newUses)
    • repairInstructionDefs

      protected abstract void repairInstructionDefs(SSAInstruction inst, int index, int[] newDefs, int[] newUses)
    • pushAssignment

      protected abstract void pushAssignment(SSAInstruction inst, int index, int newRhs)
    • popAssignment

      protected abstract void popAssignment(SSAInstruction inst, int index)
    • perform

      protected void perform()
    • getInstructions

      protected SSAInstruction[] getInstructions(IR ir)
    • iterateInstructions

      protected final Iterator<SSAInstruction> iterateInstructions(IR ir)
    • init

      protected void init()
    • placePhiNodes

      protected void placePhiNodes()
    • skipRepair

      protected boolean skipRepair(SSAInstruction inst, int index)
    • fail

      protected void fail(int v)
    • hasDefaultValue

      protected boolean hasDefaultValue(int valueNumber)
    • getDefaultValue

      protected int getDefaultValue(int valueNumber)
    • top

      protected int top(int v)