Repository navigation
Allocate TreeInfo objects using TR::Region of containing List - #7305
vijaysun-omr merged 1 commit into
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
findOrCreateTreeInfofunction fails to find aTreeInfoobject that refers to a particularTR::TreeTopin thetargetTreesList, it allocates a newTreeTopinstance usingtrStackMemory. However,findOrCreateTreeInfois called within a call tree fromDeadTreesElimination::process. Theprocessmethod creates a newTR::StackMemoryRegionon entry to the method, but thetargetTreesListhas a lifetime that extends for the duration of the optimization. (The_targetTreesis first constructed in theDeadTreesEliminationconstructor and is only cleared in theprePerformOnBlocksmethod.The
TreeInfoobjects should be allocated from the sameTR::Regionthat theListuses for allocation of its nodes to ensure that their lifetime is as long as that of the containingListobject.Fixes: Issue eclipse-openj9/openj9#19197