RFR: 8375498: [VectorAPI] Dump primary vector IR details with -XX:+TraceNewVectors

Jatin Bhateja jbhateja at openjdk.org
Wed Jan 21 10:05:20 UTC 2026


On Wed, 21 Jan 2026 07:00:51 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Patch to add support for dumping primary vector IR created by various VectorAPI inline expanders.
>> Currently auto-vectorization prints the newly create vector IR with -XX:+TraceNewVectors, similar message is
>> now emitted for VectorAPI.
>>  
>> 
>> TraceNewVectors [AutoVectorization]: 1397 AddVI === _ 1395 1396 [[ ]] #vectorx<I,4>
>> 
>> TraceNewVectors [VectorAPI]: 1591 AddVI === _ 1545 1569 [[ ]] #vectory<I,8> !jvms: IntVector::lanewiseTemplate @ bci:154 (line 798) Int256Vector::lanewise @ bci:3 (line 278) Int256Vector::lanewise @ bci:3 (line 43) IntVector::add @ bci:5 (line 1380) AddTestI::workload @ bci:34 (line 18)
>> 
>> 
>> Thanks,
>> Jatin
>
> Hi @eme64, @XiaohongGong, Let me know if you have any comments here.

> @jatin-bhateja Nice, thanks for working on this! I've been missing this feature for a while :)
> 
> Question: how did you verify that you cover all cases? I think some are missing, I found some just by scrolling down in the file a bit: https://github.com/openjdk/jdk/pull/29265/files#diff-33d0866101d899687e04303fb2232574f2cb796ce060528a243ebdc9903b01b1R3012-R3018
> 
> Could we have some way to verify that all vector nodes are traced in some way? It is just so easy to forget some. We can also file a separate RFE for that.
> 
> I'll still approve it because it already is a step in the right direction :)

Given that vector inline expanders mainly deal in Vector IR, I have only added tracing messages for primary Vector IR for a given inline expander before any Ideal transformation kicks in to match the behavior of auto-vectorization.


GNR>java  --add-modules=jdk.incubator.vector -XX:+TraceNewVectors  -XX:+UseSuperWord -XX:+UnlockExperimentalVMOptions -XX:-EnableVectorSupport -cp . AddTestI
WARNING: Using incubator modules: jdk.incubator.vector
TraceNewVectors [AutoVectorization]:  1119  LoadVector  === 799 982 965  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7; mismatched #vectorx<I,4> (does not depend only on test, unknown control)
TraceNewVectors [AutoVectorization]:  1120  StoreVector  === 973 982 967 1119  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7;
TraceNewVectors [AutoVectorization]:  1255  LoadVector  === 865 1155 1130  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched #vectorx<I,4>
TraceNewVectors [AutoVectorization]:  1256  StoreVector  === 1152 1155 1143 1255  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8;
TraceNewVectors [AutoVectorization]:  1395  LoadVector  === 987 1327 1304  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched #vectorx<I,4>
TraceNewVectors [AutoVectorization]:  1396  LoadVector  === 987 1327 1306  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched #vectorx<I,4>
TraceNewVectors [AutoVectorization]:  1397  AddVI  === _ 1395 1396  [[ ]]  #vectorx<I,4>
TraceNewVectors [AutoVectorization]:  1398  StoreVector  === 1324 1327 1307 1397  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8;
TraceNewVectors [AutoVectorization]:  1020  LoadVector  === 628 919 904  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=6; mismatched #vectorx<I,4>
TraceNewVectors [AutoVectorization]:  1021  StoreVector  === 915 919 892 1020  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=6; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=6;
TraceNewVectors [AutoVectorization]:  2553  LoadVector  === 1855 2265 2259  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched #vectorx<I,4> (does not depend only on test, unknown control)
TraceNewVectors [AutoVectorization]:  2554  StoreVector  === 2272 2265 2252 2553  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8;
TraceNewVectors [AutoVectorization]:  1180  LoadVector  === 860 1043 1025  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7; mismatched #vectorx<I,4> (does not depend only on test, unknown control)
TraceNewVectors [AutoVectorization]:  1181  StoreVector  === 1036 1043 1028 1180  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7; mismatched  Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=7;
Res = 300000
GNR>java  --add-modules=jdk.incubator.vector -XX:+TraceNewVectors  -XX:-UseSuperWord -cp . AddTestI
WARNING: Using incubator modules: jdk.incubator.vector
TraceNewVectors [VectorAPI]:  450  LoadVector  === 427 7 448  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=8; mismatched #vectory<I,8> !jvms: IntVector::fromArray0Template @ bci:33 (line 3501) Int256Vector::fromArray0 @ bci:3 (line 946) IntVector::fromArray @ bci:24 (line 3014)
TraceNewVectors [VectorAPI]:  1545  LoadVector  === 222 120 1543  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=11; mismatched #vectory<I,8> !jvms: IntVector::fromArray0Template @ bci:33 (line 3501) Int256Vector::fromArray0 @ bci:3 (line 946) IntVector::fromArray @ bci:24 (line 3014) AddTestI::workload @ bci:17 (line 16)
TraceNewVectors [VectorAPI]:  1569  LoadVector  === 559 1559 1567  [[ ]]  @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=11; mismatched #vectory<I,8> !jvms: IntVector::fromArray0Template @ bci:33 (line 3501) Int256Vector::fromArray0 @ bci:3 (line 946) IntVector::fromArray @ bci:24 (line 3014) AddTestI::workload @ bci:28 (line 17)
TraceNewVectors [VectorAPI]:  1591  AddVI  === _ 1545 1569  [[ ]]  #vectory<I,8> !jvms: IntVector::lanewiseTemplate @ bci:154 (line 798) Int256Vector::lanewise @ bci:3 (line 278) Int256Vector::lanewise @ bci:3 (line 43) IntVector::add @ bci:5 (line 1380) AddTestI::workload @ bci:34 (line 18)
TraceNewVectors [VectorAPI]:  TraceNewVectors [VectorAPI]:  1617  StoreVector  === 1313 1605 1613 229  LoadVector  === 226 227 223  [[ ]]  @rawptr:BotPTR1591  [[ ]]  @aryptr:int[int:>=0] (, idx=Raw; mismatched #vectoryjava/lang/Cloneable,java/io/Serializable):NotNull:exact+any,iid=bot, idx=11; mismatched  Memory:<I,8> (does not depend only on test, raw access) @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull !jvms: IntVector::fromArray0Template @ bci:33 (line 3501) Int256Vector::fromArray0 @ bci:3 (line 946)
:exact+any,iid=bot, idx=11; !jvms: IntVector::intoArray @ bci:44 (line 3285) AddTestI::workload @ bci:41 (line 18)
TraceNewVectors [VectorAPI]:  520  AddVI  === _ 519 518  [[ ]]  #vectory<I,8> !jvms: IntVector::lanewiseTemplate @ bci:154 (line 798) Int256Vector::lanewise @ bci:3 (line 278) Int256Vector::lanewise @ bci:3 (line 43) IntVector::add @ bci:5 (line 1380)

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

PR Comment: https://git.openjdk.org/jdk/pull/29265#issuecomment-3777193978


More information about the hotspot-compiler-dev mailing list