RFR: 8365205: C2: Optimize popcount value computation using knownbits [v3]
Emanuel Peter
epeter at openjdk.org
Wed Sep 10 16:06:04 UTC 2025
On Wed, 10 Sep 2025 15:55:42 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> For a full solution, we can add another rule to directly AND the known ZERO and ONE bits of participating inputs, and let canonicalization compute the resultant type and clean up existing handling in Value transforms and explicit constant folding
Yes, this is what we would end up with after https://bugs.openjdk.org/browse/JDK-8367341 . But I think currently, there is no good way to set / get bits directly.
Using signed comparisons as you mentioned is only of limited help. But it is what we have for now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27075#discussion_r2337233209
More information about the hotspot-compiler-dev
mailing list