if (VM.VerifyAssertions) VM.assert(def1.isRegister());
if (VM.VerifyAssertions) { if (!def1.isRegister()) VM.sysWrite("Expression folding trouble BBB" + def); VM.assert(def1.isRegister()); }
  final public static void perform (OPT_IR ir) {        // Create a set of potential computations to fold.    HashSet candidates = new HashSet(20);    for (Enumeration e = ir.forwardInstrEnumerator(); e.hasMoreElements();) {      OPT_Instruction s = (OPT_Instruction)e.nextElement();      // Check if s is a fixed-point add/subtract instruction with       // a constant second operand      OPT_Register r = isCandidateExpression(s);      if (r != null) {        candidates.add(r);      }    }    boolean didSomething = true;    while (didSomething) {      didSomething = false;      for (Iterator i = candidates.iterator(); i.hasNext(); ) {        OPT_Register r = (OPT_Register)i.next();        OPT_Instruction s = r.getFirstDef();        OPT_Operand val1 = Binary.getVal1(s);        if (VM.VerifyAssertions) VM.assert(val1.isRegister());        if (candidates.contains(val1.asRegister().register)) {          OPT_Instruction def = val1.asRegister().register.getFirstDef();          OPT_Operand def1 = Binary.getVal1(def);          if (VM.VerifyAssertions) VM.assert(def1.isRegister());          OPT_Operand def2 = Binary.getVal2(def);          if (VM.VerifyAssertions) VM.assert(def2.isConstant());          OPT_Instruction newS = transform(s,def);          s.insertAfter(newS);          OPT_DefUse.updateDUForNewInstruction(newS);          OPT_DefUse.removeInstructionAndUpdateDU(s);          didSomething = true;        }      }    }