RFR: 8365205: C2: Optimize popcount value computation using knownbits [v12]
Quan Anh Mai
qamai at openjdk.org
Mon Oct 6 15:56:55 UTC 2025
On Sat, 4 Oct 2025 06:01:07 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> This patch optimizes PopCount value transforms using KnownBits information.
>> Following are the results of the micro-benchmark included with the patch
>>
>>
>>
>> System: 13th Gen Intel(R) Core(TM) i3-1315U
>>
>> Baseline:
>> Benchmark Mode Cnt Score Error Units
>> PopCountValueTransform.LogicFoldingKerenLong thrpt 2 215460.670 ops/s
>> PopCountValueTransform.LogicFoldingKerenlInt thrpt 2 294014.826 ops/s
>>
>> Withopt:
>> Benchmark Mode Cnt Score Error Units
>> PopCountValueTransform.LogicFoldingKerenLong thrpt 2 389978.082 ops/s
>> PopCountValueTransform.LogicFoldingKerenlInt thrpt 2 417261.583 ops/s
>>
>>
>> Kindly review and share your feedback.
>>
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>
> Review comments resolution
LGTM otherwise
src/hotspot/share/opto/countbitsnode.cpp line 144:
> 142: return Type::TOP;
> 143: }
> 144: const TypeInt* tint = t->isa_int();
This should be `is_int`. `isa_int` is fine, but in cases of unexpected types, it will SIGSEGV instead of throwing an assertion, which is more difficult to debug.
-------------
Marked as reviewed by qamai (Committer).
PR Review: https://git.openjdk.org/jdk/pull/27075#pullrequestreview-3305634424
PR Review Comment: https://git.openjdk.org/jdk/pull/27075#discussion_r2407155945
More information about the hotspot-compiler-dev
mailing list