Vectorizing Loops with Control-Flow using the Vector API

Many algorithms require control-flow. As of JDK26, the HotSpot JVM does not auto vectorize loops with control-flow (other than the loop exit check). That will hopefully change in the future, but auto vectorization will always be limited. It is a pattern matching engine and can never cover all cases. That’s where the Vector API (JEP) comes to the rescue: it allows us to express vectorized…