src/share/vm/opto/cfgnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/cfgnode.cpp	Mon Jan 25 18:03:51 2016
--- new/src/share/vm/opto/cfgnode.cpp	Mon Jan 25 18:03:51 2016

*** 902,914 **** --- 902,914 ---- if( phase->type_or_null(r) == Type::TOP ) // Dead code? return Type::TOP; // Check for trip-counted loop. If so, be smarter. CountedLoopNode* l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; ! if (l && l->can_be_counted_loop(phase) && ((const Node*)l->phi() == this)) { // Trip counted loop! ! if (l && ((const Node*)l->phi() == this)) { // Trip counted loop! // protect against init_trip() or limit() returning NULL + if (l->can_be_counted_loop(phase)) { const Node *init = l->init_trip(); const Node *limit = l->limit(); const Node* stride = l->stride(); if (init != NULL && limit != NULL && stride != NULL) { const TypeInt* lo = phase->type(init)->isa_int();
*** 922,931 **** --- 922,940 ---- } else if (stride_t->_lo >= 0) { return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3); } } } + } else if (l->in(LoopNode::LoopBackControl) != NULL && + in(LoopNode::EntryControl) != NULL && + phase->type(l->in(LoopNode::LoopBackControl)) == Type::TOP) { + // During CCP, if we saturate the type of a counted loop's Phi + // before the special code for counted loop above has a chance + // to run (that is as long as the type of the backedge's control + // is top), we might end up with non monotonic types + return phase->type(in(LoopNode::EntryControl)); + } } // Until we have harmony between classes and interfaces in the type // lattice, we must tread carefully around phis which implicitly // convert the one to the other.

src/share/vm/opto/cfgnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File