op = OPT_IRTools.getMoveOp(tempVal2.type, false);
op = OPT_IRTools.getMoveOp(tempVal2.type,  ir.IRStage == OPT_IR.LIR);
  private void doCondMove(OPT_IR ir, OPT_Diamond diamond, OPT_Instruction cb) {    OPT_BasicBlock taken = diamond.getTaken();    OPT_BasicBlock notTaken = diamond.getNotTaken();    // for each non-branch instruction s in the diamond,     // copy s to a new instruction s'    // and store a mapping from s to s'    HashMap takenInstructions = new HashMap();    OPT_Instruction[] takenInstructionList = copyAndMapInstructions      (taken, takenInstructions);    HashMap notTakenInstructions = new HashMap();    OPT_Instruction[] notTakenInstructionList =      copyAndMapInstructions(notTaken, notTakenInstructions);        // Extract the values and condition from the conditional branch.    OPT_Operand val1 = IfCmp.getVal1(cb);    OPT_Operand val2 = IfCmp.getVal2(cb);    OPT_ConditionOperand cond = IfCmp.getCond(cb);    // Copy val1 and val2 to temporaries, just in case they're defined in    // the diamond.  If they're not defined in the diamond, copy prop    // should clean these moves up.    OPT_RegisterOperand tempVal1 = ir.regpool.makeTemp(val1);    OPT_Operator op = OPT_IRTools.getMoveOp(tempVal1.type, false);    cb.insertBefore(Move.create(op,tempVal1.copyRO(),val1.copy()));    OPT_RegisterOperand tempVal2 = ir.regpool.makeTemp(val2);    op = OPT_IRTools.getMoveOp(tempVal2.type, false);    cb.insertBefore(Move.create(op,tempVal2.copyRO(),val2.copy()));    // For each instruction in each temporary set, rewrite it to def a new    // temporary, and insert it before the branch.    rewriteWithTemporaries(takenInstructionList,ir);    rewriteWithTemporaries(notTakenInstructionList,ir);    insertBefore(takenInstructionList,cb);    insertBefore(notTakenInstructionList,cb);        // For each register defined in the TAKEN branch, save a mapping to    // the corresponding conditional move.    HashMap takenMap = new HashMap();        // Now insert conditional moves to replace each instruction in the diamond.    // First handle the taken branch.    if (taken != null) {      for (Enumeration e = taken.forwardRealInstrEnumerator();            e.hasMoreElements();) {        OPT_Instruction s = (OPT_Instruction)e.nextElement();         if (s.isBranch()) continue;        OPT_Operand def = (OPT_Operand)s.getDefs().nextElement();        // if the register does not span a basic block, it is a temporary        // that will now be dead        if (def.asRegister().register.spansBasicBlock()) {          OPT_Instruction tempS = (OPT_Instruction)takenInstructions.get(s);          OPT_RegisterOperand temp = (OPT_RegisterOperand)            tempS.getDefs().nextElement();          op = OPT_IRTools.getCondMoveOp(def.asRegister().type,                                         false);          OPT_Instruction cmov = CondMove.create(op,def.asRegister() ,                                                 tempVal1.copy(),                                                 tempVal2.copy(),                                                 cond.copy().asCondition(),                                                 temp.copy(),                                                 def.copy());          takenMap.put(def.asRegister().register,cmov);          cb.insertBefore(cmov);        }        s.remove();      }    }    // For each register defined in the NOT-TAKEN branch, save a mapping to    // the corresponding conditional move.    HashMap notTakenMap = new HashMap();    // Next handle the not taken branch.    if (notTaken != null) {      for (Enumeration e = notTaken.forwardRealInstrEnumerator();            e.hasMoreElements();) {        OPT_Instruction s = (OPT_Instruction)e.nextElement();         if (s.isBranch()) continue;        OPT_Operand def = (OPT_Operand)s.getDefs().nextElement();        // if the register does not span a basic block, it is a temporary        // that will now be dead        if (def.asRegister().register.spansBasicBlock()) {          OPT_Instruction tempS = (OPT_Instruction)notTakenInstructions.get(s);          OPT_RegisterOperand temp = (OPT_RegisterOperand)            tempS.getDefs().nextElement();          OPT_Instruction prevCmov = (OPT_Instruction)takenMap.get(def.asRegister                                                                   ().register);          if (prevCmov != null) {            // if this register was also defined in the taken branch, change            // the previous cmov with a different 'False' Value            CondMove.setFalseValue(prevCmov, temp.copy());            notTakenMap.put(def.asRegister().register,prevCmov);          } else {            // create a new cmov instruction            op = OPT_IRTools.getCondMoveOp(def.asRegister().type, false);            OPT_Instruction cmov = CondMove.create(op,def.asRegister(),                                                   tempVal1.copy(),                                                   tempVal2.copy(),                                                   cond.copy().asCondition(),                                                   def.copy(),                                                   temp.copy());            cb.insertBefore(cmov);            notTakenMap.put(def.asRegister().register,cmov);          }        }        s.remove();      }    }    // Mutate the conditional branch into a GOTO.    OPT_BranchOperand target = diamond.getBottom().makeJumpTarget();    Goto.mutate(cb,GOTO,target);        // Delete a potential GOTO after cb.    OPT_Instruction next = cb.getNext();    if (next.operator != BBEND) {      next.remove();    }    // Recompute the CFG.    diamond.getTop().recomputeNormalOut(ir); // fix the CFG   }