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 EA bug in generating VSPLATS #15709

Merged
merged 1 commit into from Aug 17, 2022

Conversation

r30shah
Copy link
Contributor

@r30shah r30shah commented Aug 15, 2022

In escape analyis while generating constant child of VSPLATS node, it
queries the IL API to get the opcode using the Vector IL instead of
Vector Element type. This resulted in us hitting fatal assert. This
commit fixes by supplying the element type to getOpCode query for
constant node.

Signed-off-by: Rahil Shah rahil@ca.ibm.com

@r30shah
Copy link
Contributor Author

r30shah commented Aug 15, 2022

@gita-omr / @hzongaro Can I please get your review on this?

Copy link
Member

@hzongaro hzongaro left a comment

Choose a reason for hiding this comment

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

I think the change looks good, but I noticed another location in EscapeAnalysis that uses vectorToScalar rather than getVectorElementType. Is vectorToScalar deprecated? If so, maybe you could update this change to take the opportunity to replace it with a call to getVectorElementType as well.

@hzongaro hzongaro self-assigned this Aug 16, 2022
@r30shah
Copy link
Contributor Author

r30shah commented Aug 16, 2022

@hzongaro looking at the vectorToScalar , it eventually returns self()->getVectorElementType(). I do not think it is deprecated, but I like @gita-omr to comment on this. If this query is still going to be there, I will change the getVectorElementType() with vectorToScalar() which seems more cleaner.

@gita-omr
Copy link
Contributor

I will change the getVectorElementType() with vectorToScalar() which seems more cleaner.

I think getVectorElementType() name is more clear than vectorToScalar()...

@@ -6242,7 +6242,7 @@ TR::Node *TR_EscapeAnalysis::createConst(TR::Compilation *comp, TR::Node *node,
if (type.isVector())
{
result = TR::Node::create(node, TR::ILOpCode::createVectorOpCode(TR::vsplats, type), 1);
result->setAndIncChild(0, TR::Node::create(node, comp->il.opCodeForConst(type), value));
result->setAndIncChild(0, TR::Node::create(node, comp->il.opCodeForConst(type.getVectorElementType()), value));
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Just curious: which test case caused this code to be executed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In escape analyis while generating constant child of VSPLATS node, it
queries the IL API to get the opcode using the Vector IL instead of
Vector Element type. This resulted in us hitting fatal assert. This
commit fixes by supplying the element type to getOpCode query for
constant node.
Apart from fixing the bug, this commit replaces the use of
vectorToScalar query with getVectorElementType in escape analysis
optimization.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
@@ -3871,7 +3871,7 @@ void TR_EscapeAnalysis::referencedField(TR::Node *base, TR::Node *field, bool is
int N = 1;
if (refType.isVector())
{
fieldType = refType.vectorToScalar();
fieldType = refType.getVectorElementType();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hzongaro given what Gita suggested, I think it makes sense to replace vectorToScalar query with getVectorElementType. I fixed the second occurrence that you pointed in review in https://github.com/eclipse-openj9/openj9/compare/821e45f1c7c9de5e6636985a4b59cdf2fb0979a6..9dee936f8cf7248144b47d73c71d919dfa443a97

Copy link
Member

@hzongaro hzongaro left a comment

Choose a reason for hiding this comment

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

Looks good!

@hzongaro
Copy link
Member

Gita @gita-omr, I just wanted to close the loop, and make sure you were OK with the latest update to this pull request.

@gita-omr
Copy link
Contributor

LGTM

@hzongaro
Copy link
Member

Jenkins test sanity all jdk8,jdk18

@hzongaro hzongaro merged commit 022441e into eclipse-openj9:master Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants