Withdrawn: 8267376: C2: Deduce the result bound of ModXNode
duke
duke at openjdk.java.net
Mon Sep 13 11:52:58 UTC 2021
On Tue, 25 May 2021 03:16:37 GMT, Yi Yang <yyang at openjdk.org> wrote:
> if the divisor is a constant and not equal to 0, it's possible to deduce the final bound of ModXNode given that the following rules:
>
> x % -y ==> [0, y - 1]
> x % y ==> [0, y - 1]
> -x % y ==> [-y + 1, 0]
> -x % -y ==> [-y + 1, 0]
>
>
> FYI: The original purpose of this patch is to eliminate array access range check(e.g. `arr[val%5]`) which discussed in https://github.com/openjdk/jdk/pull/4083#issuecomment-846971247, because ModXNode would be transformed to other nodes during IGVN, RangeCheckNode is still generated when accessing array element. Regardless of eliminating array access range check, it's still reasonable to deduce the bound of % operation if the divisor is known constant.
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4179
More information about the hotspot-compiler-dev
mailing list