RFR: 8307084: C2: Vectorized drain loop is not executed for some small trip counts [v2]

Emanuel Peter epeter at openjdk.org
Tue Nov 11 16:02:12 UTC 2025


On Mon, 10 Nov 2025 15:18:42 GMT, Fei Gao <fgao at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.hpp line 1434:
>> 
>>> 1432:   Node* get_vectorized_drain_input(Node* main_backedge_ctrl, VectorSet& visited,
>>> 1433:                                    Node_Stack& clones, Node* main_merge_region,
>>> 1434:                                    Node* main_phi);
>> 
>> We don't just do this for the trip-counter though, right? Because the `main_incr` suggests that a bit here. Could you rephrase to make it more accurate? Do you think that could be worth it? It is also nice to have the analogy to the trip-counter, so I like that in the example ASCII art.
>
> Yes, it applies to all values that increase as the loop iterates. I’m afraid I forgot to rename `main_incr` to a more general name after refactoring the code here. I’ll update it in the next commit. How about renaming it to `main_out`?

Ah, I just had an idea: we are talking only about the `iv` (trip counter), right? You could put `iv` in the name, for example `iv_after_main` or `main_out_iv`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22629#discussion_r2514752399


More information about the hotspot-compiler-dev mailing list