提交 0ef4f963 编写于 作者: K kvn

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
上级 4eb4bdb4
...@@ -554,9 +554,7 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { ...@@ -554,9 +554,7 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const {
return TypeInt::CC_GE; return TypeInt::CC_GE;
} else if (hi0 <= lo1) { } else if (hi0 <= lo1) {
// Check for special case in Hashtable::get. (See below.) // Check for special case in Hashtable::get. (See below.)
if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
in(1)->Opcode() == Op_ModI &&
in(1)->in(2) == in(2) )
return TypeInt::CC_LT; return TypeInt::CC_LT;
return TypeInt::CC_LE; return TypeInt::CC_LE;
} }
...@@ -567,13 +565,17 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { ...@@ -567,13 +565,17 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const {
// to be positive. // to be positive.
// (This is a gross hack, since the sub method never // (This is a gross hack, since the sub method never
// looks at the structure of the node in any other case.) // looks at the structure of the node in any other case.)
if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
in(1)->Opcode() == Op_ModI &&
in(1)->in(2)->uncast() == in(2)->uncast())
return TypeInt::CC_LT; return TypeInt::CC_LT;
return TypeInt::CC; // else use worst case results 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--------------------------------------- //------------------------------Idealize---------------------------------------
Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) { Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) {
if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) { if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {
......
...@@ -158,6 +158,7 @@ public: ...@@ -158,6 +158,7 @@ public:
CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
virtual int Opcode() const; virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const; virtual const Type *sub( const Type *, const Type * ) const;
bool is_index_range_check() const;
}; };
//------------------------------CmpPNode--------------------------------------- //------------------------------CmpPNode---------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册