RFR: 8344171: Clone and initialize Assertion Predicates in order instead of in reverse-order [v5]

Christian Hagedorn chagedorn at openjdk.org
Thu Nov 28 09:00:25 UTC 2024


> This patch changes the order in which we clone and initialize Assertion Predicates from "reverse-order" to "in-order".
> 
> #### Current State: Mostly "reverse-order" for Assertion Predicates
> We are currently cloning and initializing Assertion Predicates in reverse-order out of convenience and simplicity for most of the loop splitting optimizations - except for Loop Unswitching (see next section). This means that we do the following:
> 
>                                      old target loop entry
>                                                |
>          x                         Cloned Template Assertion
>          |                                Predicate 2
> Template Assertion                             |
>     Predicate 1                       Initialized Assertion
>          |               ==>               Predicate 2
> Template Assertion                             |
>     Predicate 2                    Cloned Template Assertion
>          |                                Predicate 1
>     source loop                                |
>                                       Initialized Assertion
>                                            Predicate 1
>                                                |
>                                           target loop
> 
> I don't think this is wrong but still kinda unexpected when trying to reason about a graph. But now with the recent refactorings, I think it's easy to change this to an in-order processing:
> 
>                                      old target loop entry
>                                                |
>          x                          Cloned Template Assertion
>          |                                Predicate 1
> Template Assertion                             |
>     Predicate 1                       Initialized Assertion
>          |               ==>               Predicate 1
> Template Assertion                             |
>     Predicate 2                     Cloned Template Assertion
>          |                                Predicate 2
>     source loop                                |
>                                       Initialized Assertion
>                                            Predicate 2
>                                                |
>                                           target loop
> 
>  This will also align all cloning/initializing of Assertion Predicates to the same order which was not the case before: Loop Unswitching already had an in-order cloning.
> 
> #### Why Does Loop Unswitching Use In-Order?
> The main reason wa...

Christian Hagedorn has updated the pull request incrementally with two additional commits since the last revision:

 - Revert "8344035: Replace predicate walking code in Loop Unswitching with a predicate visitor"
   
   This reverts commit 550933659a8021131d9d1424fc6ff77b51745cbe.
 - 8344035: Replace predicate walking code in Loop Unswitching with a predicate visitor

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22275/files
  - new: https://git.openjdk.org/jdk/pull/22275/files/07fca8a2..8ea09a10

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22275&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22275&range=03-04

  Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/22275.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22275/head:pull/22275

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


More information about the hotspot-compiler-dev mailing list