RFR: 8324751: C2 SuperWord: Aliasing Analysis runtime check [v11]

Emanuel Peter epeter at openjdk.org
Tue Aug 19 06:09:47 UTC 2025


On Mon, 18 Aug 2025 14:47:00 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Would that be helpful to you? How?
>> What would you expect to see here @vnkozlov ?
>> This is really an optimization that reduces the code-size.
>> Or do you just want to sanity-check that the peek performance would be identical if we use multiversioning rather than the predicate approach?
>
> You did benchmarking for `LoopMultiversioningOptimizeSlowLoop`.
> 
>> use multiversioning rather than the predicate approach
> 
> This one.
> 
> Does alias analysis runtime checks requires both, multiversion and predicate, or can work only with one?
> If both enabled, which one you select for alias analisys?

I described it at the top of the PR:
> I am adding a dynamic (runtime) aliasing check to the auto-vectorizer (SuperWord). We use the infrastructure from https://github.com/openjdk/jdk/pull/22016:
>
> - Use the auto-vectorization predicate when available: we speculate that there is no aliasing, else we trap and re-compile without the predicate.
> - If the predicate is not available, we use multiversioning, i.e. we have a fast_loop where there is no aliasing, and hence vectorization. And a slow_loop if the check fails, with no vectorization.

So if only one of them is available, we expect vectorization - at least as long as the check never fails. If we only have the predicate and not multiversioning, and the predicate fails, then we will never get a slow-loop.

But sure, I can run some sanity benchmarking with only multiversioning and predicate disabled. I expect the peek performance to be identical, but compilation time will be slightly higher because we also always compile the slow-loop even if not needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24278#discussion_r2284161476


More information about the hotspot-compiler-dev mailing list