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 13:56:31 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/share/opto/vectorization.hpp line 458:
>>
>>> 456: class VLoopPointers : public StackObj {
>>> 457: private:
>>> 458: Arena* _arena;
>>
>> Will the pointer ever change? Could potentially change this to a reference.
>
> 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 ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18577#discussion_r1548127900
More information about the hotspot-compiler-dev
mailing list