RFR: 8371603: C2: Missing Ideal optimizations for load and store vectors on SVE
Xiaohong Gong
xgong at openjdk.org
Fri Dec 5 07:50:07 UTC 2025
On Thu, 4 Dec 2025 12:09:51 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Is it better that we add an assertion of non `nullptr` value before returning in `gen_masked_vector` , consider this might make the caller code clean?
>
> If you do the assert inside the method, then later someone may just do `return nullptr` somewhere, and your assert won't catch it, right?
>
> I would just do this:
>
> if (Matcher::vector_needs_partial_operations(this, vt)) {
> Node* n = VectorNode::gen_masked_vector(phase, this, vt);
> if (n != nullptr) { return n; }
> }
>
> Or you could even combine the methods `vector_needs_partial_operations` and `gen_masked_vector` into some `Ideal_partial_operations`:
>
> Node* progress = VectorNode::Ideal_partial_operations(phase, vt, this);
> if (progress != nullptr) { return progress; }
>
> That would remove the most clutter from the caller method.
Sounds good to me. I will change the code by combining the methods into a function. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28651#discussion_r2591722969
More information about the hotspot-compiler-dev
mailing list