RFR: 8335444: Generalize implementation of AndNode mul_ring [v2]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Tue Aug 6 03:41:04 UTC 2024


> Hi all,
> I've written this patch which improves type calculation for bitwise-and functions. Previously, the only cases that were considered were if one of the inputs to the node were a positive constant. I've generalized this behavior, as well as added a case to better estimate the result for arbitrary ranges. Since these are very common patterns to see, this can help propagate more precise types throughout the ideal graph for a large number of methods, making other optimizations and analyses stronger. I was interested in where this patch improves types, so I ran CTW for `java_base` and `java_base_2` and printed out the differences in this gist [here](https://gist.github.com/jaskarth/b45260d81ab621656f4a55cc51cf5292). While I don't think it's particularly complicated I've also added some discussion of the mathematics below, mostly because I thought it was interesting to work through :)
> 
> This patch passes tier1-3 testing on my linux x64 machine. Thoughts and reviews would be very appreciated!

Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:

  Fix IR test checks and add benchmark

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20066/files
  - new: https://git.openjdk.org/jdk/pull/20066/files/808d8067..1de4cee9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20066&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20066&range=00-01

  Stats: 22 lines in 2 files changed: 16 ins; 4 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/20066.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20066/head:pull/20066

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


More information about the hotspot-compiler-dev mailing list