Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ICF assert in pdcmpgt vector evaluator #3330

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

fjeremic
Copy link
Contributor

The vector registers in question are marked as part of the ICF which is
certainly not the case. RA will assert that we are trying to assign
registers within ICF. To alleviate this we add a label right after the
vector compare instruction and set ICF on the label.

Signed-off-by: Filip Jeremic [email protected]

The vector registers in question are marked as part of the ICF which is
certainly not the case. RA will assert that we are trying to assign
registers within ICF. To alleviate this we add a label right after the
vector compare instruction and set ICF on the label.

Signed-off-by: Filip Jeremic <[email protected]>
@fjeremic
Copy link
Contributor Author

@NigelYiboYu could I please get a review?

break;
default:
TR_ASSERT(0, "Unrecognized op code in pd cmp vector evaluator helper.");
}

cursor = generateLoad32BitConstant(cg, node, 0, resultReg, true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we should assert inside of these APIs that can take in dependencies for ICF. i.e. if you have ICF start already marked and you call this API and you don't pass in dependencies then assert because you're doing something wrong. This API can potentially allocate a register depending on the constant being loaded and that register has to be added to the dependencies. Food for thought.

@fjeremic
Copy link
Contributor Author

Jenkins test sanity zlinux JDK8

@pshipton
Copy link
Member

@fjeremic is this is must fix for the 0.11 release? Does it / will it affect zLinux?

@pshipton pshipton added this to the Release 0.11.0 milestone Oct 18, 2018
@fjeremic
Copy link
Contributor Author

@fjeremic is this is must fix for the 0.11 release? Does it / will it affect zLinux?

This is a must fix for 0.11.0. It will affect Linux on Z (only on z14).

@fjeremic fjeremic added the bug label Oct 18, 2018
Copy link
Contributor

@NigelYiboYu NigelYiboYu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -2701,8 +2701,8 @@ J9::Z::TreeEvaluator::pdcmpVectorEvaluatorHelper(TR::Node *node, TR::CodeGenerat
generateRRInstruction(cg, TR::Compiler->target.is64Bit() ? TR::InstOpCode::XGR : TR::InstOpCode::XR, node, resultReg, resultReg);
generateLoad32BitConstant(cg, node, 1, resultReg, true);

TR::RegisterDependencyConditions* deps = new(cg->trHeapMemory()) TR::RegisterDependencyConditions(0, 1, cg);
TR::LabelSymbol* doneCompareLabel = TR::LabelSymbol::create(cg->trHeapMemory(), cg);
TR::RegisterDependencyConditions* deps = new(cg->trHeapMemory()) TR::RegisterDependencyConditions(0, 2, cg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 2 post dependencies? I only see one call of addPostCondition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because generateLoad32BitConstant can potentially allocate another register?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implicit dependency changes in APIs like generateLoad32BitConstant() can be tricky.. How do we know the number of dependencies they are adding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because generateLoad32BitConstant can potentially allocate another register?

Yes, this is precisely it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implicit dependency changes in APIs like generateLoad32BitConstant() can be tricky.. How do we know the number of dependencies they are adding?

This is a problem today. I can't fix the issue at the moment but I opened one a long time ago that we need to have dynamically allocated register dependencies. It's absurd to expect developers do count them manually when it costs basically nothing to just allocate them dynamically.

@@ -2701,8 +2701,8 @@ J9::Z::TreeEvaluator::pdcmpVectorEvaluatorHelper(TR::Node *node, TR::CodeGenerat
generateRRInstruction(cg, TR::Compiler->target.is64Bit() ? TR::InstOpCode::XGR : TR::InstOpCode::XR, node, resultReg, resultReg);
generateLoad32BitConstant(cg, node, 1, resultReg, true);

TR::RegisterDependencyConditions* deps = new(cg->trHeapMemory()) TR::RegisterDependencyConditions(0, 1, cg);
TR::LabelSymbol* doneCompareLabel = TR::LabelSymbol::create(cg->trHeapMemory(), cg);
TR::RegisterDependencyConditions* deps = new(cg->trHeapMemory()) TR::RegisterDependencyConditions(0, 2, cg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implicit dependency changes in APIs like generateLoad32BitConstant() can be tricky.. How do we know the number of dependencies they are adding?

@fjeremic
Copy link
Contributor Author

fjeremic commented Oct 18, 2018

@pshipton do you want to be the committer for this one? I see we have not split the 0.11.0 branch so I assume I don't have to double deliver?

Edit:

FYI Jenkins tests were already launched and have passed.

@pshipton pshipton merged commit 369b5d2 into eclipse-openj9:master Oct 18, 2018
@pshipton
Copy link
Member

Correct, the branch has not yet occurred.

@fjeremic fjeremic deleted the fix-icf-pd-vector branch October 18, 2018 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants