On Tue, 1 Sep 2026 12:51:32 GMT, Roberto Castañeda Lozano <[email protected]> wrote:
>>> I removed the Phi + And + Prototype header shape recognition that was >>> removed in this simplification >>> [230b329](https://github.com/openjdk/jdk/commit/230b3297114f7e3b7adfc7de6e05808f36110c63). >>> I guess this is the correct thing to do, even if that recognition and >>> optimisation could be used in the future if we decide to use the prototype >>> again. >>> >>> I think I correctly preserved the normal "and all the marks and check the >>> header/mark bit mask" ideal folding. But would be nice to get some C2 >>> engineer to look at these C2 changes. >> >> The C2 changes look good, but it would be good to have better test coverage >> of the specific idealizations updated in the changeset (asserting that the >> optimizations still occur and work correctly after the update). Let me try >> to sketch some additional tests. > >> Let me try to sketch some additional tests. > > Here is a bunch of tests that check that the updated idealizations in > `AndLNode::Ideal` work as expected. I went with low-level primitives (loading > the markword via `UNSAFE.getLong`) for robustness and simplicity. I ran the > tests successfully in all Oracle-supported platforms, with no additional > configuration (the tests expect a flagless VM, to avoid undesired > interactions with flags like e.g. `UseArrayFlattening`): > https://github.com/openjdk/jdk/commit/57335fe00915daee4840671f7ceafa90689c75ac. > Feel free to incorporate them into this PR, if you want. > > I also checked manually that `FlatArrayCheck` nodes with multiple array > inputs are expanded as expected after the changeset, but the pattern to > trigger that is too cumbersome to derive an IR test from it. Thanks for the test. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32544#issuecomment-5495443362
