Skip to content

Commit

Permalink
Merge pull request #6158 from Akira1Saitoh/aarch64CmpImmRelo
Browse files Browse the repository at this point in the history
AArch64: Add relocation record for second child of ifacmpeq/ifacmpne
  • Loading branch information
knn-k authored Aug 25, 2021
2 parents ab70342 + 347c244 commit 1d0a329
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions compiler/aarch64/codegen/ControlFlowEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ static TR::Instruction *ificmpHelper(TR::Node *node, TR::ARM64ConditionCode cc,
TR::LabelSymbol *dstLabel;
TR::Instruction *result;
TR::RegisterDependencyConditions *deps;
bool secondChildNeedsRelocation = cg->profiledPointersRequireRelocation() && (secondChild->getOpCodeValue() == TR::aconst) &&
(secondChild->isClassPointerConstant() || secondChild->isMethodPointerConstant());

#ifdef J9_PROJECT_SPECIFIC
if (cg->profiledPointersRequireRelocation() && secondChild->getOpCodeValue() == TR::aconst &&
(secondChild->isClassPointerConstant() || secondChild->isMethodPointerConstant()))
if (secondChildNeedsRelocation)
{
if (node->isProfiledGuard())
{
Expand Down Expand Up @@ -176,7 +177,7 @@ if (cg->profiledPointersRequireRelocation() && secondChild->getOpCodeValue() ==
}
}

if (secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
if ((!secondChildNeedsRelocation) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
{
int64_t value = is64bit ? secondChild->getLongInt() : secondChild->getInt();
if (constantIsUnsignedImm12(value) || constantIsUnsignedImm12(-value) ||
Expand Down Expand Up @@ -371,8 +372,10 @@ static TR::Register *icmpHelper(TR::Node *node, TR::ARM64ConditionCode cc, bool
TR::Node *secondChild = node->getSecondChild();
TR::Register *src1Reg = cg->evaluate(firstChild);
bool useRegCompare = true;
bool secondChildNeedsRelocation = cg->profiledPointersRequireRelocation() && (secondChild->getOpCodeValue() == TR::aconst) &&
(secondChild->isClassPointerConstant() || secondChild->isMethodPointerConstant());

if (secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
if ((!secondChildNeedsRelocation) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
{
int64_t value = is64bit ? secondChild->getLongInt() : secondChild->getInt();
if (constantIsUnsignedImm12(value) || constantIsUnsignedImm12(-value) ||
Expand Down

0 comments on commit 1d0a329

Please sign in to comment.