RFR: 8370454: C2 SuperWord: unsigned comparison information is lost for VectorMaskCmp

Hamlin Li mli at openjdk.org
Wed Oct 22 20:55:12 UTC 2025


Hi,
Can you help to review the patch? @eme64 

Currently, in SLP if we support transformation from (Bool + CmpU + CMove) to (VectorMaskCmp + VectorBlend), the unsigned comparison information is lost, it's in CmpU, but current code only check Bool for the information. For details please check code at `SuperWordVTransformBuilder::make_vector_vtnode_for_pack` and `PackSet::get_bool_test`.

This loss of unsigned comparison information blocks the optimization proposed in https://github.com/openjdk/jdk/pull/25336 and https://github.com/openjdk/jdk/pull/25341.

Currently, `BoolTest` does not support an unsigned construction (`BoolTest( mask btm ) : _test(btm) { assert((btm & unsigned_compare) == 0, "unsupported");}`), seems to me a feasible solution would be get the unsigned information from CmpU (which could be an input of Bool) and pass it to VectorMaskCmp.

Thanks

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

Commit messages:
 - refactor
 - revert blank line
 - initial commit
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - ... and 7 more: https://git.openjdk.org/jdk/compare/f158451c...6271a8e7

Changes: https://git.openjdk.org/jdk/pull/27942/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27942&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8370454
  Stats: 8 lines in 2 files changed: 8 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/27942.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27942/head:pull/27942

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


More information about the hotspot-compiler-dev mailing list