Skip to content

Commit

Permalink
Merge pull request #7430 from jdmpapin/mustBeNotEqual-off
Browse files Browse the repository at this point in the history
Reinstate original VPClass::mustBeNotEqual() logic temporarily
  • Loading branch information
vijaysun-omr authored Aug 1, 2024
2 parents bdfb2d5 + 8c99d26 commit 382516c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions compiler/optimizer/VPConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5122,6 +5122,31 @@ bool TR::VPClass::mustBeNotEqual(TR::VPConstraint *other, OMR::ValuePropagation
if (isNonNullObject() && other->isNullObject())
return true;

// The new logic below is causing some test failures that need to be investigated.
// This original logic is reinstated in the meantime.
if (getKnownObject() && other->getKnownObject() && isNonNullObject() && other->isNonNullObject())
return getKnownObject()->getIndex() != other->getKnownObject()->getIndex();

TR::VPClass *otherClass = NULL;
if (other)
otherClass = other->asClass();
if (!_preexistence &&
!_arrayInfo && _type &&
_type->isFixedClass() && isNonNullObject() &&
other && otherClass &&
!otherClass->getArrayInfo() &&
!otherClass->isPreexistentObject() &&
otherClass->getClassType() && otherClass->getClassType()->isFixedClass() && otherClass->isNonNullObject() &&
(isClassObject() == TR_yes) &&
(other->isClassObject() == TR_yes))
{
if (_type->asFixedClass()->getClass() != otherClass->getClassType()->asFixedClass()->getClass())
return true;
}

return false;

#if 0
if (!isNonNullObject() && !other->isNonNullObject())
return false; // both could be null

Expand Down Expand Up @@ -5285,6 +5310,7 @@ bool TR::VPClass::mustBeNotEqual(TR::VPConstraint *other, OMR::ValuePropagation
// Two unrelated non-interface classes can't have a common subtype.
return vp->fe()->isInstanceOf(thisClass, otherClass, true, true) != TR_yes
&& vp->fe()->isInstanceOf(otherClass, thisClass, true, true) != TR_yes;
#endif
}

bool TR::VPNullObject::mustBeNotEqual(TR::VPConstraint *other, OMR::ValuePropagation *vp)
Expand Down

0 comments on commit 382516c

Please sign in to comment.