Register operands have a type for their register and a flag that says, amongst other things, whether this register must exactly be that type (precise) or not. When a checkcast operation occurs it refines the type of the register operand, currently the assignment in OPT_BC2IR is:
if (op2 instanceof OPT_RegisterOperand && !op2.asRegister().isPreciseType()) {
op2.asRegister().setType(typeRef);
}
That is, we believe the checkcast will give us more accurate type information then the type information already in the register operand, unless the register operand has precise type information. The current code doesn't handle the case where the type information is more exact than the check cast but the register isn't precise. The exactness of the register type influences future optimizations like guarded inlining, that can benefit from knowing a register can only have a type belonging to a subset of the class hierarchy.