RFR: 8342095: Add autovectorizer support for subword vector casts [v12]

Emanuel Peter epeter at openjdk.org
Mon May 12 06:29:56 UTC 2025


On Mon, 12 May 2025 03:08:28 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:

>> @jaskarth Just checked the internal testing. Saw this failure with `-XX:UseAVX=1`:
>> 
>> 
>> Failed IR Rules (2) of Methods (2)
>> ----------------------------------
>> 1) Method "public java.lang.Object[] compiler.loopopts.superword.TestCompatibleUseDefTypeSize.testByteToLong(byte[],long[])" - [Failed IR rules: 1]:
>>    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#V#VECTOR_CAST_B2L#_", "_ at min(max_byte, max_long)", ">0"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={"AlignVector", "false", "UseCompactObjectHeaders", "false"}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={"avx", "true"}, applyIfAnd={}, applyIfNot={})"
>>      > Phase "PrintIdeal":
>>        - counts: Graph contains wrong number of nodes:
>>          * Constraint 1: "(\\d+(\\s){2}(VectorCastB2X.*)+(\\s){2}===.*vector[A-Za-z]<J,2>)"
>>            - Failed comparison: [found] 0 > 0 [given]
>>            - No nodes matched!
>> 
>> 2) Method "public java.lang.Object[] compiler.loopopts.superword.TestCompatibleUseDefTypeSize.testLongToByte(long[],byte[])" - [Failed IR rules: 1]:
>>    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#V#VECTOR_CAST_L2B#_", "_ at min(max_long, max_byte)", ">0"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={"AlignVector", "false", "UseCompactObjectHeaders", "false"}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={"avx", "true"}, applyIfAnd={}, applyIfNot={})"
>>      > Phase "PrintIdeal":
>>        - counts: Graph contains wrong number of nodes:
>>          * Constraint 1: "(\\d+(\\s){2}(VectorCastL2X.*)+(\\s){2}===.*vector[A-Za-z]<B,2>)"
>>            - Failed comparison: [found] 0 > 0 [given]
>>            - No nodes matched!
>
> @eme64 Thanks for the testing results! It looks like byte<->long conversion isn't supported with AVX1, so I've pushed a small to make the test to check for AVX2 in those cases instead.

@jaskarth Excellent! I'll run another round of testing, just to be sure :)
Please ping me again in 24h!

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

PR Comment: https://git.openjdk.org/jdk/pull/23413#issuecomment-2871032679


More information about the hotspot-compiler-dev mailing list