-
Notifications
You must be signed in to change notification settings - Fork 396
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
Consider possibility of TR::newvalue operation in some optimizations #7031
Consider possibility of TR::newvalue operation in some optimizations #7031
Conversation
Prevent local reordering for newvalue operations as is already done for other object allocation operations, such as new, newarray, etc.
A local (stack allocated) object might be created with a TR::newvalue opcode in downstream projects. Allow for that possibility in the assertion that appears in OMR::AutomaticSymbol::createLocalObject.
@vijaysun-omr, may I ask you to review this change? |
@@ -357,6 +357,7 @@ void TR_LocalReordering::moveStoresEarlierIfRhsAnchored(TR::Block *block, TR::Tr | |||
!node->getOpCode().isTreeTop() && | |||
!node->getOpCode().isCall() && | |||
(node->getOpCodeValue() != TR::New) && | |||
(node->getOpCodeValue() != TR::newvalue) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this spot chosen in particular for some reason ? i.e. was the rest of the optimizer checked for places where new* opcodes are dealt with and only this one mattered for this change ? Maybe the point is that this ought to have been changed when newvalue was added along with N other places using new* opcodes that were changed properly and this commit is just fixing that bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a case that ought to have been checked for when prototype support for newvalue
was originally added. In the process of prototyping support downstream in OpenJ9 for escape analysis for newvalue
operations, I tracked down a test failure to the fact that local reordering was not checking for newvalue
operations.
jenkins build all |
This pull request includes changes to consider the possibility that an object allocation is being performed by way of a
TR::newvalue
operation. One is in the context ofLocalReordering
, which already prevented reordering of other kinds of object allocations. The second is in the context ofOMR::AutomaticSymbol::createLocalObject
which is used in the process of stack allocating short-lived objects that do not need to be allocated on the heap, allowing downstream projects to stack allocate objects that were created by aTR::newvalue
operation.