RFR: 8286941: Add mask IR for partial vector operations for ARM SVE [v9]

Emanuel Peter epeter at openjdk.org
Fri Nov 28 06:38:14 UTC 2025


On Fri, 28 Nov 2025 01:33:44 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.cpp line 996:
>> 
>>> 994:   }
>>> 995:   return LoadNode::Ideal(phase, can_reshape);
>>> 996: }
>> 
>> @XiaohongGong Extremely late review 😉 
>> 
>> Does this not prevent us from doing the `LoadNode::Ideal` optimizations for the cases where `vector_needs_partial_operations` returns true?
>> 
>> See also: https://bugs.openjdk.org/browse/JDK-8371603
>
> If `vector_needs_partial_operations` returns true, then the original `LoadVectorNode` is either transformed to a `LoadVectorMaskedNode` or `nullptr`. So it seems `LoadNode::Ideal` is not called if `try_to_gen_masked_vector` returns `nullptr` and some optmizations are missing? That would be an issue.

Yes, exactly. I think instead of:

return VectorNode::try_to_gen_masked_vector(phase, this, vt);

we should do

Node* progress = VectorNode::try_to_gen_masked_vector(phase, this, vt);
if (progress != nullptr) { return progress; }

That should be correct, right?

Of course the naming here is a bit confusing, and suggests that this may not be correct. Because `vector_needs_partial_operations` would suggest we _always_ need to do partial operations. And so then we would expect that `try_to_gen_masked_vector` would have to _always_ succeed. And so maybe that is why the reviewers did not think that we should continue with `LoadNode::Ideal` if it fails, I suppose? So I think the names should be changed to `maybe_vector_needs_partial_operations` and `transform_to_partial_vector_if_needed`, or similar. What do you think?

Of course I hit an example in [JDK-8371603](https://bugs.openjdk.org/browse/JDK-8371603) where we don't step over MergeMems, which may already be an issue. But I would still like to find some other examples of missing optimizations. Let's see what I can find. Working through QEMU is a bit slow ;)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/9037#discussion_r2570603928


More information about the hotspot-compiler-dev mailing list