[code-reflection] RFR: Bytecode round 12 [v3]

Adam Sotona asotona at openjdk.org
Wed Sep 4 06:37:36 UTC 2024


On Tue, 3 Sep 2024 19:53:29 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> This code detect there is no path from a VarLoadOp to the entry block that bypass the VarStoreOps. The default initialization is necessary if there is such path. I've just made it more abstract as a dominance test of a dominant set.
>
> I still don't understand why the second check is needed, traversing the predecessors of `n`'s declaring block. If `n` is not dominated by any values in set `doms` then presumably such traversal has to encounter the entry block? 
> 
> The implementation of `Value::isDominatedBy` defers to block domination:
> 
>     public boolean isDominatedBy(Value dom) {
>         if (this == dom) {
>             return true;
>         }
> 
>         if (declaringBlock() != dom.declaringBlock()) {
>             return declaringBlock().isDominatedBy(dom.declaringBlock());
>         }
> ...

Individual dominations are handled as you describe. It applies for cases like this:

entry -> var -> var store -> var load
            \
              > var store -> var load 


However following case needs a test for dominant set:

entry -> var -> var store -> var load
            \             /
              > var store

The var load is not dominated by any individual var store, however it is dominated by them.

The test should fail for example on following case:

entry -> var -> var store -> var load
             \            /     
                ---------


The reason why the second part is focused on blocks only is because ops cannot form a bypass inside one block.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/219#discussion_r1743149575


More information about the babylon-dev mailing list