RFR: 8326962: C2 SuperWord: cache VPointer

Emanuel Peter epeter at openjdk.org
Tue Apr 2 15:45:11 UTC 2024


On Tue, 2 Apr 2024 15:38:49 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Is it important for this to be Arena-allocated? Seems to me like `compute_and_cache` will only be computed once per `VLoopPointers` instance, right?
>
> We can discuss if Arena-allocated is the right thing to do. But for now it is what I did with all other submodules of `VLoopAnalyzer`, so if we were to change this, then I can do that in a separate RFE.
> 
> What alternative would you prefer, and why?
> 
> I like Arena-allocation, because I have a clear location and life-time for my allocations. I can close the arena after all AutoVectorization, and I know that the data is valid up to that point, and then it gets deallocated.
> 
> CHeap allocation would require me to be more smart and careful about deallocation.
> 
> Resouce allocation in my experience often is problematic if you have different life-times for things. I like Resource-allocation only for temporary data structures, not data that is used across a large algorithm with dozens of subalgorithms.
> 
> Let me know what you think ;)

> Will the pointer ever change? Could potentially change this to a reference.
I could make it a reference. But data structures like `GrowableArray` take a `Arena*`. So then I have to use `*` and `&` all the time. I don't like that, it makes the code much more "noisy".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18577#discussion_r1548130142


More information about the hotspot-compiler-dev mailing list