RFR: 8370666: VectorAPI: Add clear comments for vector relative code in c2 [v3]

Xiaohong Gong xgong at openjdk.org
Fri Jan 16 09:34:43 UTC 2026


On Fri, 16 Jan 2026 08:28:08 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update comments in type.cpp
>
> src/hotspot/share/opto/vectornode.hpp line 1513:
> 
>> 1511: // and incrementing by 1 up to "VLENGTH - 1". So far, the first input is an int
>> 1512: // constant 0. For example, a 128-bit vector with int (32-bit) elements produces
>> 1513: // a vector like "[0, 1, 2, 3]".
> 
> Are you saying that `in1` has to be a constant with value zero? Actually, it seems the backend just ignores the input value... so why do we even have it?

Yes, `in1` is a constant with zero and it can be ignored in backend codegen. I'm unsure about the root cause why we still need it. It deserves an investigation. Maybe it's necessary for a floating node that has no control input for some phases? I'm not sure. When I tried to remove it , I met hotspot crashes when running jtreg tests:

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (jdk/src/hotspot/share/opto/node.hpp:418), pid=2345980, tid=2346012
#  assert(i < _max) failed: oob: i=1, _max=1


The call stack is:

Stack: [0x0000e66182a7f000,0x0000e66182c7d000],  sp=0x0000e66182c775d0,  free space=2017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x138a0ac]  Node::in(unsigned int) const [clone .part.0]+0x2c  (node.hpp:418)
V  [libjvm.so+0x13a36b4]  PhaseIdealLoop::get_early_ctrl(Node*)+0x400  (node.hpp:418)
V  [libjvm.so+0x13a48e8]  PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x658  (loopnode.cpp:250)
V  [libjvm.so+0x13b26e4]  PhaseIdealLoop::build_and_optimize()+0x654  (loopnode.cpp:5134)
V  [libjvm.so+0xa35ba0]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x360  (loopnode.hpp:1233)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29130#discussion_r2697682558


More information about the hotspot-compiler-dev mailing list