-
Notifications
You must be signed in to change notification settings - Fork 397
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
Allocate TreeInfo objects using TR::Region of containing List #7305
Allocate TreeInfo objects using TR::Region of containing List #7305
Conversation
@vijaysun-omr, may I ask you to review this change? One thing that isn't absolutely clear to me is whether it's absolutely necessary to allow for the possibility that I attempted test runs with assertions added to check for that possibility, and did not encounter any assertion failures. However, I don't know whether there's a guarantee that that situation could not arise. I think this change is safe, but it might be that we could instead narrow the lifetime of |
Thanks @hzongaro I don't know of a reason why we would want to refer to a tree info for something that was processed in a prior pass of the dead trees elimination optimization (as I think was the gist of your question). This is a bit clunky since the state of the IL trees could have changed to make the "height" calculation wrong in the intervening optimizations. So I think
is an option to consider. |
Thanks, @vijaysun-omr. I've reviewed the usage of |
Thanks, you can squash the commits and I can run testing after that. |
The _targetTrees List is used to keep track of TR::TreeTops that are being processed. In applying the optimization to requested blocks, the DeadTreesElimination::process(TR::TreeTop*,TR::TreeTop*) method is called for all TR::TreeTops in an entire extended basic block; otherwise it is called for all TR::TreeTops in the method. After the process method returns, TR:TreeTops in that range will not need to be visited again during the current application of Dead Trees Elimination, so there's no need to track them in a _targetTrees field associated with the optimization. Instead the field can be made into a local variable in the process method, with memory allocated in the in scope StackMemoryRegion object. The TreeInfo objects that are stored in the List by the findOrCreateTreeInfo function should be allocated from the same TR::Region that the List uses for allocation of its nodes to ensure that their lifetime is as long as that of the containing List object.
870af4d
to
149b872
Compare
Jenkins build all |
jenkins build riscv |
jenkins build win |
jenkins build riscv |
The riscv failure does not appear to be specific to this pull request:
The same failure appears in this PR build for pull request #7315. The x86-64 macOS failure appears to be due to known issue #7181. |
If the
findOrCreateTreeInfo
function fails to find aTreeInfo
object that refers to a particularTR::TreeTop
in thetargetTrees
List
, it allocates a newTreeTop
instance usingtrStackMemory
. However,findOrCreateTreeInfo
is called within a call tree fromDeadTreesElimination::process
. Theprocess
method creates a newTR::StackMemoryRegion
on entry to the method, but thetargetTrees
List
has a lifetime that extends for the duration of the optimization. (The_targetTrees
is first constructed in theDeadTreesElimination
constructor and is only cleared in theprePerformOnBlocks
method.The
TreeInfo
objects should be allocated from the sameTR::Region
that theList
uses for allocation of its nodes to ensure that their lifetime is as long as that of the containingList
object.Fixes: Issue eclipse-openj9/openj9#19197