RFR: 8305637: Remove Opaque1 nodes for Parse Predicates and clean up useless predicate elimination [v2]
Christian Hagedorn
chagedorn at openjdk.org
Thu Aug 31 12:50:36 UTC 2023
On Tue, 29 Aug 2023 08:39:39 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> This is the last clean-up PR before the complete fix for Assertion Predicates ([JDK-8288981](https://bugs.openjdk.org/browse/JDK-8288981)).
>>
>> This patch includes:
>> - Removal of `ConI`->`Opaque1`->`Conv2B` input nodes for `ParsePredicateNodes` with the following additional changes:
>> - Adjusting `ParsePredicateNode` to block unwanted optimizations (added empty `ParsePredicateNode::Ideal()`).
>> - Changing `Compile::_parse_predicate_opaqs` to not store `Opaque1Nodes` to keep track of Parse Predicates but instead storing `ParsePredicateNodes` directly. Renamed to `Compile::_parse_predicates` and adjusted related methods.
>> - Removed asserts matching `Opaque1` -> `Conv2B` shape.
>> - Cleaning up `eliminate_useless_predicates()`:
>> - Adjust code to find useful/useless Parse Predicates with the new `Compile::_parse_predicates` list with `ParsePredicateNodes` instead of `Opaque1Nodes`.
>> - Changing `ParsePredicateNode` to carry a `_useless` state which simplifies the elimination of useless predicates with `eliminate_useless_predicates()` and during IGVN (added `ParsePredicateNode::Value()` for that which also removes the predicate once we are in post loop opts IGVN).
>> - Some refactoring/clean-ups of involved code.
>>
>> Testing: tier1-7 + some fuzzer testing
>>
>> Thanks,
>> Christian
>
> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>
> remove hash_delete()
I've pushed an update with the following changes:
- `is_uncommon_trap_if_pattern()` and `is_uncommon_trap_proj()`:
- Changed `Deoptimization::Deopt_Reason` into a default argument for `is_uncommon_trap_if_pattern()` and `is_uncommon_trap_proj()` as most calls are only interested if the `If` just represents such a pattern. This allowed us to remove all the `Deoptimization::Reason_none` arguments in the calling code.
- Changed them into `const` methods.
- Removed/Moved Parse Predicate checking in `is_uncommon_trap_if_pattern()` as this should be the responsibility of the caller. The method simply wants to check if there is such a pattern with the given deopt reason.
- `create_new_if_for_predicate()`:
- The continuation projection is always a Parse Predicate success projection (i.e. true projection). Changed types and variable names accordingly.
- Other renaming and removing dead code.
- Changed some variable names to better highlight that where Parse Predicate success projections are passed around.
But I could also split these changes in a separate PR.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15449#issuecomment-1700971776
More information about the hotspot-compiler-dev
mailing list