7181658: CTW: assert(t->meet(t0) == t) failed: Not monotonic
authorkvn
Wed, 11 Jul 2012 14:50:30 -0700
changeset 13205 5495b63764bf
parent 13204 589e566a5ca8
child 13206 e51c1cecb49c
child 13291 9de3b1387cb8
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
hotspot/src/share/vm/opto/subnode.cpp
hotspot/src/share/vm/opto/subnode.hpp
--- a/hotspot/src/share/vm/opto/subnode.cpp	Mon Jul 02 12:59:43 2012 -0700
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Wed Jul 11 14:50:30 2012 -0700
@@ -554,9 +554,7 @@
       return TypeInt::CC_GE;
     } else if (hi0 <= lo1) {
       // Check for special case in Hashtable::get.  (See below.)
-      if ((jint)lo0 >= 0 && (jint)lo1 >= 0 &&
-          in(1)->Opcode() == Op_ModI &&
-          in(1)->in(2) == in(2) )
+      if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
         return TypeInt::CC_LT;
       return TypeInt::CC_LE;
     }
@@ -567,13 +565,17 @@
   // to be positive.
   // (This is a gross hack, since the sub method never
   // looks at the structure of the node in any other case.)
-  if ((jint)lo0 >= 0 && (jint)lo1 >= 0 &&
-      in(1)->Opcode() == Op_ModI &&
-      in(1)->in(2)->uncast() == in(2)->uncast())
+  if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
     return TypeInt::CC_LT;
   return TypeInt::CC;                   // else use worst case results
 }
 
+bool CmpUNode::is_index_range_check() const {
+  // Check for the "(X ModI Y) CmpU Y" shape
+  return (in(1)->Opcode() == Op_ModI &&
+          in(1)->in(2)->eqv_uncast(in(2)));
+}
+
 //------------------------------Idealize---------------------------------------
 Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) {
   if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {
--- a/hotspot/src/share/vm/opto/subnode.hpp	Mon Jul 02 12:59:43 2012 -0700
+++ b/hotspot/src/share/vm/opto/subnode.hpp	Wed Jul 11 14:50:30 2012 -0700
@@ -158,6 +158,7 @@
   CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
   virtual int Opcode() const;
   virtual const Type *sub( const Type *, const Type * ) const;
+  bool is_index_range_check() const;
 };
 
 //------------------------------CmpPNode---------------------------------------