RFR: 8289996: Fix array range check hoisting for some scaled loop iv

Quan Anh Mai duke at openjdk.org
Sun Jul 17 16:57:08 UTC 2022


On Sun, 17 Jul 2022 08:28:41 GMT, Pengfei Li <pli at openjdk.org> wrote:

>> src/hotspot/share/opto/mulnode.cpp line 277:
>> 
>>> 275:         phase->C->record_for_post_loop_opts_igvn(this);
>>> 276:         return NULL;
>>> 277:       }
>> 
>> This defers the whole idealisation, should we only skip this particular transformation instead? Also should this be applied to `MulLNode`, too? Thanks.
>
> I think this only defers the transformation if scale value is a constant and has exactly 2 bits set in binary. Could you elaborate how to make it more particular?
> 
> AFAIK, all normal Java array accesses are using 32-bit indices. When running on a 64-bit platform, we use a `ConvI2L` in element address computing but it's done after whole index expression computing. Is there any special array accesses that may use `MulL`?

I mean this stops the whole idealisation as soon as the constant has exactly 2 bits set, I think we should still try other transformations in `MulNode::Ideal` in those cases.

IIRC, memory segment accesses use long arithmetic, so they need this changes, too.

Thanks.

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

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


More information about the hotspot-compiler-dev mailing list