RFR: 8335257: Refactor code to create Initialized Assertion Predicates into separate class
Emanuel Peter
epeter at openjdk.org
Wed Jul 3 15:27:22 UTC 2024
On Wed, 3 Jul 2024 15:07:23 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> This is the next patch for Assertion Predicates. It refactors the code to create an Initialized Assertion Predicate. Changes include:
>>
>> - `clone_assertion_predicate_and_initialize()` currently does two things: Cloning a Template Assertion Predicate and creating an Initailized Assertion Predicate. I've split this method into two methods `clone_template_assertion_predicate()` and `create_initialized_assertion_predicate()`:
>> - `clone_template_assertion_predicate()`: Now only clones the template. I have not cleaned the code up further because I will soon replace the `If` node with a dedicated `TemplateAssertionPredicateNode`.
>> - `create_initialized_assertion_predicate()`: I refactored the code for Initialized Assertion Predicate into a separate class `InitializedAssertionPredicate` which creates the complete Initialized Assertion Predicate `If` with a `HaltNode`. I could get rid of some of the arguments because they can be fetched inside the new class methods.
>> - Moved `assertion_predicate_has_loop_opaque_node()` asserts to both methods.
>> - Renamed `AssertionPredicateType::Init_value` -> `AssertionPredicateType::InitValue` (same for last value).
>>
>> Thanks,
>> Christian
>
> src/hotspot/share/opto/predicates.cpp line 412:
>
>> 410: IfTrueNode* InitializedAssertionPredicate::create(Node* control) {
>> 411: IdealLoopTree* loop = _phase->get_loop(control);
>> 412: OpaqueInitializedAssertionPredicateNode* new_opaque_bool = create_new_bool(control);
>
> This is confusing: I ask for a `bool` but get an `opaque`...
Better might be: `create_initialized_assertion_predicate_expression`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19940#discussion_r1664371329
More information about the hotspot-compiler-dev
mailing list