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

Stop generating deprecated unsigned opcodes of equality compare and const #4347

Merged
merged 4 commits into from Nov 27, 2019

Conversation

wbh123456
Copy link
Contributor

Delete any creations or recreations of node with unsigned deprecated IL opcodes in Equality compare/Equality Compare and Branch/Constant category.

Using TR_ASSERT_FATAL to ensure no downstream projects will attempt to use aforementioned opcodes.

Issue: #2657
Signed-off-by: Bohao(Aaron) Wang aaronwang0407@gmail.com

@andrewcraik
Copy link
Contributor

Are any changes required in downstream projects before the ASSERT_FATAL is added? We don't want to break consumers of OMR needlessly.

@wbh123456
Copy link
Contributor Author

Are any changes required in downstream projects before the ASSERT_FATAL is added? We don't want to break consumers of OMR needlessly.

Any creation with Equality compare/Equality Compare and Branch/Constant opcodes in the list of #2657 would need to be removed.

@wbh123456 wbh123456 changed the title WIP: Stop generating deprecated unsigned opcodes of equality compare and const Stop generating deprecated unsigned opcodes of equality compare and const Sep 24, 2019
@andrewcraik
Copy link
Contributor

@wbh123456 since the fatal assert is in another WIP PR can you remove it from here for now then we can at least merge this change to stop generating some of these deprecated opcodes....

@wbh123456
Copy link
Contributor Author

@wbh123456 since the fatal assert is in another WIP PR can you remove it from here for now then we can at least merge this change to stop generating some of these deprecated opcodes....

The fatal asserts for this PR is only asserting the generations of the deprecated Equality compare/Equality Compare and Branch/Constant Opcodes, which is only within the scope of this PR.

@wbh123456
Copy link
Contributor Author

Passed internal testings with OpenJ9 master branch. Should be good for a review. @andrewcraik

@andrewcraik
Copy link
Contributor

@genie-omr build all

@andrewcraik
Copy link
Contributor

Appveyor build looks to be infra - dependency download failure.

@wbh123456
Copy link
Contributor Author

The OMR check failures are likely infra errors. @andrewcraik

@andrewcraik
Copy link
Contributor

@genie-omr build all

@andrewcraik
Copy link
Contributor

Doing a quick search in OpenJ9 as a major consumer of OMR they have at least one place lest that generates a cconst that could fail with the assert added in this commit (https://github.com/eclipse/openj9/blob/d8be80662bce5a7d8dd62b79cd6daf2abd3be9ca/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp#L1777).

@wbh123456
Copy link
Contributor Author

Doing a quick search in OpenJ9 as a major consumer of OMR they have at least one place lest that generates a cconst that could fail with the assert added in this commit (https://github.com/eclipse/openj9/blob/d8be80662bce5a7d8dd62b79cd6daf2abd3be9ca/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp#L1777).

This cconst is a TR::Node::cconst function which is different from a TR::cconst IL opcode. In addition, I have mapped the cconst creation from sconst to cconst inside the TR::Node::cconst function. There should be no other cconst creations in OpenJ9.

static bool isNotDeprecatedUnsigned(TR::ILOpCodes opvalue)
{

TR::ILOpCodes DeprecatedUnsignedList [] =
Copy link
Contributor

Choose a reason for hiding this comment

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

per other PRs in your series please convert to a switch statement on the opcode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the structure of this function in 1a4a32c. Keep the structure consistent with the same function in #4367.
FYI, there are 2 other WIP PRs also introducing the same function using the old structure. I will unWIP those PRs and resolve the conflicts there to update this function once this PR or #4367 has been merged.

@wbh123456 wbh123456 force-pushed the unsigned_gen branch 2 times, most recently from 1a4a32c to 7d9723e Compare October 10, 2019 19:09
@wbh123456
Copy link
Contributor Author

This PR is good for a review. @Leonardo2718 @andrewcraik @vijaysun-omr

@Leonardo2718
Copy link
Contributor

@genie-omr build all

@@ -13245,7 +13245,7 @@ TR::Node *ificmpneSimplifier(TR::Node * node, TR::Block * block, TR::Simplifier
}

if (node->getOpCodeValue() == TR::ificmpne)
intCompareNarrower(node, s, TR::ifsucmpne, TR::ifscmpne, TR::ifbcmpne);
intCompareNarrower(node, s, TR::ifscmpne, TR::ifscmpne, TR::ifbcmpne); //ushortOp is the same as shortOp in this case
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why this needs a comment - the others don't

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why this comment is there. I don't think I wrote that comment. Do you think it is a good idea to just remove it as it does not give much useful information.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you added it, but regardless it is redundant and should be removed IMO.

@andrewcraik
Copy link
Contributor

Modulo the comment issue above - I'm good with this.

@Leonardo2718
Copy link
Contributor

@genie-omr build all

@Leonardo2718
Copy link
Contributor

@genie-omr build all

@Leonardo2718
Copy link
Contributor

@genie-omr build aix

@wbh123456
Copy link
Contributor Author

Passed all the checks + Passed all the extended internal testings. Should be good for a review. @Leonardo2718 @vijaysun-omr

@wbh123456
Copy link
Contributor Author

wbh123456 commented Oct 31, 2019

This PR maps the creations of any of the following ILOpcodes into appropriate signed version.
bucmpeq bucmpne iucmpeq iucmpne lucmpeq lucmpne sucmpeq sucmpne
ifiucmpeq ifiucmpne iflucmpeq iflucmpne ifbucmpeq ifbucmpne ifsucmpeq ifsucmpne
buconst iuconst luconst cconst.
(e.g. cconst --> sconst, ifsucmpeq --> ifscmpeq)

Note that there isn't any coordinate delivery to this PR.

Checks that have been done to ensure correctness and performance:

  • Performed extended internal testings
  • Fatal asserted any creation or recreations of the above Opcodes
  • Checked the code path of all uses/references of above opcodes to ensure their mapped signed version would work the same way as the deprecated unsigned version
  • Checked all associated idiomrecognition units, all mappings performed would not affect its pattern recognized.

FYI @andrewcraik

@Leonardo2718
Copy link
Contributor

@genie-omr build all

@Leonardo2718
Copy link
Contributor

@andrewcraik Given #4604, I'm wondering if we can expedite merging this PR?

@andrewcraik
Copy link
Contributor

@wbh123456 I see a merge commit on Nov 11 I don't think we want that in the history can you just rebase the changes up? @Leonardo2718 I'm fine with the change (as indicated by the approved review) once the merge commit is cleaned up. As long as people have checked we aren't breaking OpenJ9 this should be good to go. If there is a change needed to prevent OpenJ9 breaking then we should make sure that is merged first.

@wbh123456
Copy link
Contributor Author

I have properly rebased the changes in fbf26e2. Sorry for the inconvenience I brought. FYI @andrewcraik @Leonardo2718

@andrewcraik
Copy link
Contributor

@genie-omr build all

Signed-off-by: Bohao(Aaron) Wang <aaronwang0407@gmail.com>
Specifically, remove creation of opcodes in Equality compare and equality compare
and branch

Signed-off-by: Bohao(Aaron) Wang <aaronwang0407@gmail.com>
…equality

Add TR_ASSERT_FATAL to ensure there is no more creatation or recreation
of node with deprecated opcode in the equality compare and equality compare branch
category

Signed-off-by: Bohao(Aaron) Wang <aaronwang0407@gmail.com>
Signed-off-by: Bohao(Aaron) Wang <aaronwang0407@gmail.com>
@andrewcraik
Copy link
Contributor

@genie-omr build all

Copy link
Contributor

@Leonardo2718 Leonardo2718 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

None yet

3 participants