candidates.removeAll(replace.keySet()); candidates.addAll(replace.values());
  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      if (isCandidateExpression(s)) {        candidates.add(s);      }    }    boolean didSomething = true;    while (didSomething) {      didSomething = false;      for (Iterator i = candidates.iterator(); i.hasNext(); ) {        OPT_Instruction s = (OPT_Instruction)i.next();        OPT_Operand val1 = Binary.getVal1(s);        if (VM.VerifyAssertions) VM.assert(val1.isRegister());        OPT_Instruction def = val1.asRegister().register.getFirstDef();        if (candidates.contains(def)) {          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());          transform(s,def);          didSomething = true;        }      }    }  }      