[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-compiler-dev
Subject:    Integrated: 8325746: Refactor Loop Unswitching code
From:       Christian Hagedorn <chagedorn () openjdk ! org>
Date:       2024-02-28 7:07:08
Message-ID: VDMOQoXeWvpAXcYhtzERaazRyOnoGTLhnr1TLU6bNVg=.b77bf656-4b66-4b12-9daf-bb1e51b46777 () github ! com
[Download RAW message or body]

On Wed, 14 Feb 2024 09:06:03 GMT, Christian Hagedorn <chagedorn@openjdk.org> wrote:

> To simplify the review of https://github.com/openjdk/jdk/pull/16877, I've decided \
> to split off some code into separate sub-tasks. 
> This sub-task focuses on the code refactoring done in Loop Unswitching. I've \
> incorporated the feedback from @eme64 at https://github.com/openjdk/jdk/pull/16877 \
> in the proposed changes. 
> #### Changes
> - Adding a more detailed description about the Loop Unswitching optimization itself \
>                 below the file header.
> - Renaming `fast loop` -> `true-path-loop` and `slow loop` -> `false-path-loop` \
> since we don't really know which one is faster and to avoid keeping a mental map of \
>                 which path goes into which unswitched loop version.
> - Creating new classes:
> - `UnswitchedLoopSelector` to create the unswitched loop selector `If` (i.e. the If \
> node that selects at runtime which unswitched loop version is executed) based on \
>                 the invariant and non-loop-exiting unswitch candidate `If`.
> - `OriginalLoop` to do the actual unswitching (i.e. loop cloning, predicates \
>                 cloning and fixing the graph to the loop selector `If`).
> - Extracting methods in `do_unswitching()` to clean it up further.
> - Improving `TraceLoopUnswitching` result printing.
> - Adding some shared utility methods.
> 
> #### Possible Follow-Up RFEs
> There are possible follow-up opportunities to further improve the loop unswitching \
> which, however, would go to far in the context of fixing Assertion Predicates. We \
>                 could follow up with RFEs to tackle these:
> - At some point it might be good to have a dedicated `LoopUnswitching` class to \
> split all the methods off from `PhaseIdealLoop`. This would also avoid noisy \
>                 "loop_unswitching" prefixes.
> - Bailout code in `has_control_dependencies_from_predicates()` is too conservative. \
> I have already some code to improve that in the full fix for Assertion Predicates \
>                 which I plan to split off and propose separatly.
> - `TraceLoopUnswitching` currently only prints the result and if it failed. We \
> might want to improve that in the future to cover more steps to make it useful for \
> debugging (would require some more fine-grained debug levels, though).

This pull request has now been integrated.

Changeset: 6cad07c2
Author:    Christian Hagedorn <chagedorn@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6cad07c23b16aa9eb5a5a0674344d494843601dc
                
Stats:     550 lines in 6 files changed: 367 ins; 86 del; 97 mod

8325746: Refactor Loop Unswitching code

Reviewed-by: epeter, kvn

-------------

PR: https://git.openjdk.org/jdk/pull/17842


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic