RFR: 8263707: C1 RangeCheckEliminator support constant array and NewMultiArray

Tobias Hartmann thartmann at openjdk.java.net
Tue Mar 23 07:03:47 UTC 2021


On Wed, 17 Mar 2021 06:10:14 GMT, Hui Shi <hshi at openjdk.org> wrote:

> …rray
> 
> C1 misses range check elimination opportunities for constant and NewMultiArray with fixed length now. This patch adds constant length node for load/store Indexed node when array is constant array or allocated with NewMultiArray  and its first dimension length is constant.
> 
> Tested on linux x64 release/fastdebug with tier1 and tier2.
> 
> Regards
> Hui

Looks good to me. I've also executed some internal testing and it all passed.

src/hotspot/share/c1/c1_Canonicalizer.cpp line 251:

> 249:       set_constant(length->type()->as_IntConstant()->value());
> 250:     } else if ((nma = x->array()->as_NewMultiArray()) != NULL) {
> 251:       if ((length = nma->dims()->at(0)->as_Constant()) != NULL) {

The ifs could be merged.

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3041


More information about the hotspot-compiler-dev mailing list