7181658: CTW: assert(t->meet(t0) == t) failed: Not monotonic

Wed, 11 Jul 2012 14:50:30 -0700

author
kvn
date
Wed, 11 Jul 2012 14:50:30 -0700
changeset 3910
ae9241bbce4a
parent 3909
70862d781d01
child 3911
cc787232c4c5
child 3926
6d8f36bcef55

7181658: CTW: assert(t->meet(t0) == t) failed: Not monotonic
Summary: Use uncast node equivalence checks in CmpUNode::sub.
Reviewed-by: kvn, twisti
Contributed-by: vladimir.x.ivanov@oracle.com

src/share/vm/opto/subnode.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/subnode.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/subnode.cpp	Mon Jul 02 12:59:43 2012 -0700
     1.2 +++ b/src/share/vm/opto/subnode.cpp	Wed Jul 11 14:50:30 2012 -0700
     1.3 @@ -554,9 +554,7 @@
     1.4        return TypeInt::CC_GE;
     1.5      } else if (hi0 <= lo1) {
     1.6        // Check for special case in Hashtable::get.  (See below.)
     1.7 -      if ((jint)lo0 >= 0 && (jint)lo1 >= 0 &&
     1.8 -          in(1)->Opcode() == Op_ModI &&
     1.9 -          in(1)->in(2) == in(2) )
    1.10 +      if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
    1.11          return TypeInt::CC_LT;
    1.12        return TypeInt::CC_LE;
    1.13      }
    1.14 @@ -567,13 +565,17 @@
    1.15    // to be positive.
    1.16    // (This is a gross hack, since the sub method never
    1.17    // looks at the structure of the node in any other case.)
    1.18 -  if ((jint)lo0 >= 0 && (jint)lo1 >= 0 &&
    1.19 -      in(1)->Opcode() == Op_ModI &&
    1.20 -      in(1)->in(2)->uncast() == in(2)->uncast())
    1.21 +  if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
    1.22      return TypeInt::CC_LT;
    1.23    return TypeInt::CC;                   // else use worst case results
    1.24  }
    1.25  
    1.26 +bool CmpUNode::is_index_range_check() const {
    1.27 +  // Check for the "(X ModI Y) CmpU Y" shape
    1.28 +  return (in(1)->Opcode() == Op_ModI &&
    1.29 +          in(1)->in(2)->eqv_uncast(in(2)));
    1.30 +}
    1.31 +
    1.32  //------------------------------Idealize---------------------------------------
    1.33  Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) {
    1.34    if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {
     2.1 --- a/src/share/vm/opto/subnode.hpp	Mon Jul 02 12:59:43 2012 -0700
     2.2 +++ b/src/share/vm/opto/subnode.hpp	Wed Jul 11 14:50:30 2012 -0700
     2.3 @@ -158,6 +158,7 @@
     2.4    CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
     2.5    virtual int Opcode() const;
     2.6    virtual const Type *sub( const Type *, const Type * ) const;
     2.7 +  bool is_index_range_check() const;
     2.8  };
     2.9  
    2.10  //------------------------------CmpPNode---------------------------------------

mercurial