提交 38056108 编写于 作者: V vlivanov

8154831: CastII/ConvI2L for a range check is prematurely eliminated

Reviewed-by: kvn, thartmann
上级 376db8da
...@@ -446,7 +446,9 @@ uint CastIINode::size_of() const { ...@@ -446,7 +446,9 @@ uint CastIINode::size_of() const {
} }
uint CastIINode::cmp(const Node &n) const { uint CastIINode::cmp(const Node &n) const {
return TypeNode::cmp(n) && ((CastIINode&)n)._carry_dependency == _carry_dependency; return TypeNode::cmp(n) &&
((CastIINode&)n)._carry_dependency == _carry_dependency &&
((CastIINode&)n)._range_check_dependency == _range_check_dependency;
} }
Node *CastIINode::Identity(PhaseTransform *phase) { Node *CastIINode::Identity(PhaseTransform *phase) {
...@@ -523,7 +525,7 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { ...@@ -523,7 +525,7 @@ const Type *CastIINode::Value(PhaseTransform *phase) const {
} }
Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) { Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) {
if (_carry_dependency) { if (_carry_dependency || _range_check_dependency) {
return NULL; return NULL;
} }
return ConstraintCastNode::Ideal_DU_postCCP(ccp); return ConstraintCastNode::Ideal_DU_postCCP(ccp);
......
...@@ -547,8 +547,12 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { ...@@ -547,8 +547,12 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const {
// All unsigned values are LE -1 and GE 0. // All unsigned values are LE -1 and GE 0.
if (lo0 == 0 && hi0 == 0) { if (lo0 == 0 && hi0 == 0) {
return TypeInt::CC_LE; // 0 <= bot return TypeInt::CC_LE; // 0 <= bot
} else if ((jint)lo0 == -1 && (jint)hi0 == -1) {
return TypeInt::CC_GE; // -1 >= bot
} else if (lo1 == 0 && hi1 == 0) { } else if (lo1 == 0 && hi1 == 0) {
return TypeInt::CC_GE; // bot >= 0 return TypeInt::CC_GE; // bot >= 0
} else if ((jint)lo1 == -1 && (jint)hi1 == -1) {
return TypeInt::CC_LE; // bot <= -1
} }
} else { } else {
// We can use ranges of the form [lo..hi] if signs are the same. // We can use ranges of the form [lo..hi] if signs are the same.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册