return generateBranchingTypeCheck(s, ir, ref, LHStype, RHStib, succBlock,
return generateBranchingTypeCheck(s, ir, ref.copy(), LHStype, RHStib, succBlock,
  static OPT_Instruction checkcast(OPT_Instruction s, OPT_IR ir) {    OPT_Operand ref = TypeCheck.getClearRef(s);    VM_TypeReference LHStype = TypeCheck.getType(s).getTypeRef();    OPT_RegisterOperand guard = ir.regpool.makeTempValidation();    OPT_Instruction nullCond =       IfCmp.create(REF_IFCMP, guard, ref.copy(),                    new OPT_NullConstantOperand(),                   OPT_ConditionOperand.EQUAL(),                    null, // KLUDGE...we haven't created the block yet!                   new OPT_BranchProfileOperand());    s.insertBefore(nullCond);    OPT_BasicBlock myBlock = s.getBasicBlock();    OPT_BasicBlock failBlock = myBlock.createSubBlock(s.bcIndex, ir, .0001f);    OPT_BasicBlock instanceOfBlock = myBlock.splitNodeAt(nullCond, ir);    OPT_BasicBlock succBlock = instanceOfBlock.splitNodeAt(s, ir);    IfCmp.setTarget(nullCond, succBlock.makeJumpTarget()); // fixup KLUDGE    myBlock.insertOut(instanceOfBlock);    myBlock.insertOut(succBlock);    instanceOfBlock.insertOut(failBlock);    instanceOfBlock.insertOut(succBlock);    ir.cfg.linkInCodeOrder(myBlock, instanceOfBlock);    ir.cfg.linkInCodeOrder(instanceOfBlock, succBlock);    ir.cfg.addLastInCodeOrder(failBlock);    OPT_Instruction raiseError =       Trap.create(TRAP, null, OPT_TrapCodeOperand.CheckCast());    raiseError.copyPosition(s);    failBlock.appendInstruction(raiseError);    OPT_RegisterOperand RHStib = getTIB(s, ir, ref, guard.copyD2U());    return generateBranchingTypeCheck(s, ir, ref, LHStype, RHStib, succBlock,                                       failBlock, null, OPT_BranchProfileOperand.never());  }