RFR: 8347645: C2: XOR bounded value handling blocks constant folding [v33]

Johannes Graham duke at openjdk.org
Tue Feb 25 16:24:59 UTC 2025


On Tue, 25 Feb 2025 16:19:39 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> FYI I'm working on fuzzing the compiler currently, so I'm thinking about how to write such tests more generally, that's why I took the time to come up with this. If you have better ideas, I'm more than happy to see them ;)
>
> I started down the path of more elaborate randomization (see code removed in https://github.com/openjdk/jdk/pull/23089/commits/4a2912021103cefbe30fb3cc9e7d303b63ea454d). Instead of that approach. I went with doing the more detailed coverage with gtest, and having just a few specific checks in the IR tests. For example the "pow2" tests are there because that was a scenario that caused some trouble. I think there is a relatively small set of "interesting" cases that are nice to cover with something deterministic. (I could add a few more tests with hard-coded interesting values). It feels disproportionate to do something more complicated for this PR. 
> 
> That said, if there was more tooling in place to make more broad random tests easier to write, it would be very attractive. Looking at PR https://github.com/openjdk/jdk/pull/23418, it looks like that's what you've got in mind. Specifically, these kinds of tests with constants are begging for a way to spew out a whole bunch of related test methods.

Also, as you commented on somewhere above, having a way to target Types from a stand-alone gtest, would also be a really nice way of making things more testable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23089#discussion_r1970120588


More information about the hotspot-compiler-dev mailing list