RFR: 8367389: C2 SuperWord: refactor VTransform to model the whole loop instead of just the basic block [v2]

Emanuel Peter epeter at openjdk.org
Wed Sep 17 11:45:37 UTC 2025


On Wed, 17 Sep 2025 09:03:48 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   for Manuel
>
> Thank you for your continued effort on this, @eme64! The overall change looks good to me, but I have a few minor suggestions and questions.

@mhaessig Thanks for the comments! I realized I had some extra code comments "pending" on github, so I added them now.

@mhaessig Ready for re-review ;)

> src/hotspot/share/opto/superwordVTransformBuilder.cpp line 143:
> 
>> 141:       init_req_with_scalar(n, vtn, MemNode::ValueIn);
>> 142:       add_memory_dependencies_of_node_to_vtnode(n, vtn, vtn_memory_dependencies);
>> 143:     } else if (n->isa_CountedLoop()) {
> 
> Suggestion:
> 
>     } else if (n->is_CountedLoop()) {
> 
> This is an implicit `!= nullptr`  otherwise.

Good catch!

> src/hotspot/share/opto/vectorization.cpp line 228:
> 
>> 226:       PhiNode* head = _heads.at(alias_idx);
>> 227:       if (head == nullptr) {
>> 228:         // We did not find a phi on this slice yet -> must be a slice with only loads.
> 
> Could you elaborate for my understanding why this is? Could this not find the load before the phi?

We loop over `_body.body()`, which is already topologically ordered. So if the `load` depends on the `phi` on the memory graph, then the `phi` must already have been found.

I'll add a comment in the code.

> src/hotspot/share/opto/vtransform.hpp line 30:
> 
>> 28: #include "opto/vectorization.hpp"
>> 29: #include "opto/vectornode.hpp"
>> 30: #include "utilities/debug.hpp"
> 
> Am I missing something, because I cannot make out the use?

Good catch!

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

PR Comment: https://git.openjdk.org/jdk/pull/27208#issuecomment-3302599208
PR Comment: https://git.openjdk.org/jdk/pull/27208#issuecomment-3302600873
PR Review Comment: https://git.openjdk.org/jdk/pull/27208#discussion_r2355221323
PR Review Comment: https://git.openjdk.org/jdk/pull/27208#discussion_r2355213338
PR Review Comment: https://git.openjdk.org/jdk/pull/27208#discussion_r2355228785


More information about the hotspot-compiler-dev mailing list