RFR: 8307084: C2: Vectorized drain loop is not executed for some small trip counts [v4]
Emanuel Peter
epeter at openjdk.org
Fri Jan 30 08:48:31 UTC 2026
On Thu, 29 Jan 2026 16:27:21 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> > But then we'd still always pay the price of the drain loop, even if it then gets folded away. Not great.
>
> May I ask why? We only need to clone the post loop after we decide to vectorize. At which point it becomes the drain loop, otherwise there is no need for the clone.
Ah, I see. So you would do pre/main/post, immediately run the vectorizer on main, if we are about to succeed, clone the post-loop down (possibly multiple times), so we then have some drain loops and a post loop. Then apply the VTransform to the main loop and the drain loops, but with different "vectorization unrolling factors". @merykitty Is that what you are suggesting?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22629#issuecomment-3822563551
More information about the hotspot-compiler-dev
mailing list