Enable boolean store simplification and disable other CFG simplifications #8005
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is comprised of three changes related to the CFG Simplification optimization:
It re-enables the boolean store simplification of CFG Simplifier.
It fixes a bug in boolean store simplification in examining the values used in two stores on both sides of an if-then-else. The code was testing whether either value that was being stored was an internal pointer. However, it got the values of both stores based on whether the first of the two stores was indirect: if it was indirect, the value of the store must be the child at index 1; otherwise, the value of the store must be the child at index 0. However, if the first store was indirect, but the second was direct, it would access a non-existent child of the second store at index 1. Fixed this by delaying retrieving the values until after comparing the opcodes of the two stores for equality, ensuring both are indirect stores or both are direct stores.
Several patterns and corresponding transformations in CFG Simplification have never been fully tested — in particular,
simplifyNullToException,simplifySimpleStore, simplifyCondStoreSequence,simplifyInstanceOfTestToCheckcastandsimplifyBoundCheckWithThrowException. This change disables those transformations by default, allowing them to be enabled based on the settings of various environment variables. The intention is that they should be more thoroughly tested and then re-enabled as that testing and any necessary bug fixes have been completed.