-
Couldn't load subscription status.
- Fork 773
Add support for offheap allocation in multianewarray evaluator on IBM Z platform #22797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add support for offheap allocation in multianewarray evaluator on IBM Z platform #22797
Conversation
|
Remove WIP when I finish testing |
|
Local tests pass. I remove the WIP and launching jenkin tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VermaSh - Can I request your review on this first for off heap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhances the multianewarray evaluator to support offheap allocation on
IMB Z platform. Offheap allocation for arrays with a zero-length second
dimension is not supported; in such cases, a helper call is triggered
to handle the allocation.
Please fix typo (IBM Z not IMB Z).
I have not looked into your code - but can you confirm this statement is true or not.
- We did inline zero-length first / second dimension array when off-heap is enabled. But changes in this PR will divert those case to helper (Or only zero length second dimension) and only inlines if both dimension is not zero?
d4792d2 to
f7b0fe2
Compare
|
Thanks @r30shah! I fixed the commit message. Yes, we were inlining zero length 2D arrays before, then we disable inlining offheap and with this change we enable offheap except for zero length second dim. |
|
Is it that complicated to fix for zero second length that you will do in second PR? |
No I have a few ideas but want to select a plan that has minimum impact on the non zero allocation since I expect non-zero to get called more frequently. |
| dependencies->addPostCondition(dim2SizeReg, TR::RealRegister::AssignAny); | ||
| cursor = generateRXInstruction(cg, TR::InstOpCode::LTGF, node, dim2SizeReg, generateS390MemoryReference(dimsPtrReg, 0, cg), cursor); | ||
| iComment("Load 2st dim length."); | ||
| // The size of zero length array is already loaded in size register. Jump over the array size calculation instructions if length is 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're no longer writing 0 to dim2SizeReg, this comment can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks shubham. Comment was removed
f7b0fe2 to
deaab6d
Compare
|
@hzongaro pointed that we do not inline constant non-zero second dimension 2D arrays (#22562 (review)). I am trying to see why it was added and will remove the condition if it is not necessary anymore. |
f788654 to
fa536c3
Compare
|
@ehsankianifar Is this ready for review or are you still working on adding changes? |
Thanks @VermaSh, Yes it is ready for review. |
Enhances the multianewarray evaluator to support offheap allocation on IBM Z platform. Offheap allocation for arrays with a zero-length second dimension is not supported; in such cases, a helper call is triggered to handle the allocation. signed-off-by: Ehsan Kiani Far <[email protected]>
Enhances the multianewarray evaluator to support zero-length offheap allocation on IBM Z platform. signed-off-by: Ehsan Kiani Far <[email protected]>
Previously, inlining of constant 2D arrays with a non-zero second dimension was disabled on z due to limitations in handling such cases. However, recent improvements have resolved those issues, making it safe and beneficial to inline these arrays. Remove the constraint that prevented inlining of non-zero constant second dimension 2D arrays. signed-off-by: Ehsan Kiani Far <[email protected]>
50f14ea to
1618674
Compare
|
I upload a sample compilation log with constant zero length here for reference: |
|
Thank you! @ehsankianifar. Can you please share trace logs for constant and non-constant non-zero 2nd dimension? |
|
Thanks @VermaSh, |
@r30shah
This PR add support for offheap 2D array allocation. It is calling helper if the second dim is zero length and allocating offheap. I have a few possible solutions for that.