-
Notifications
You must be signed in to change notification settings - Fork 733
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
Add the missing live locals info to the new blocks in tree lowering #10976
Conversation
@liqunl @andrewcraik Ready for review. Thanks! |
It's possible this PR also fixes #10365 |
This will only fix gc map issue caused by ValueType lowering. Any opt that adds new blocks to the CFG after GRA (jprofiling is another example) will have the same problem. The reason is that GRA runs liveness analysis, and setLiveLocals on codegen to indicate there is liveness info on blocks, such that codegen can use it to compute gc map. As more and more complicated opts are added to post-GRA, this problem may become more relevant. And it's hard for a developer to tell the invisible dependency between GRA and gc map computation. Maybe we should run liveness analysis in codegen to get a correct and most-recent liveness info before computing gc map. @andrewcraik What do you think? |
@liqunl I am not sure if liveness analysis will work once the optimizer is shutdown and the trees have started to be transformed ready for evaluation. You could experiment with running it since it seems reasonable, but I am not certain it will work and we may have to fix up the liveness. We need an issue to note all the places that need to be fixed. |
@liqunl @andrewcraik For my learning development, I'm curious of how the current liveness analysis is done. Could you point me to where the code (which file or function) is? If liveness analysis is moved to codegen, would this PR patching up |
GRA computes the liveness here https://github.com/eclipse/omr/blob/master/compiler/optimizer/GlobalRegisterAllocator.cpp#L398-L447 |
I tried
[1]
[2]
[3]
|
@a7ehuo Thanks for the experiments. It turned out there are more problems than we thought in doing liveness info in codegen, I feel like it should be doable because GlobalLiveVariablesForGC will lower trees before doing liveness analysis, so the tree shape should be similar to the one in codegen. But we can look at this approach later when manually fixing liveness becomes too tedious or impossible. |
Thanks for the example @liqunl. I added the following two changes during liveness analysis from https://github.com/eclipse/openj9/blob/c18472815f59d96865211b54583153db9bceb351/runtime/compiler/optimizer/LiveVariablesForGC.cpp#L208-L215 |
Looks like adding the above two changes does not solve the issue. Ran sanity.functional test with a7ehuo/openj9@0eab767, the |
@andrewcraik With the test/experiment that's done so far on moving the liveness analysis to codegen, there are more things to consider to make it work. Could you review this PR if we should take this manual fix in tree lowering for now? Thanks! |
I am not sure if running/rerunning that analysis is the right fix. The tactical fix seems more appropriate for the time being. |
aa425ff
to
c9b7b38
Compare
When the tree is transformed into new blocks in fastpathAcmpHelper or lowerArrayStoreCHK, the live locals info is not passed on from the previous block to the newly created blocks. The missing live locals causes missing GC map for the objects. Depends on eclipse-omr/omr#5639 Fixes eclipse-openj9#10869 Signed-off-by: Annabelle Huo <[email protected]>
c9b7b38
to
eb542cc
Compare
Close this PR. The issue is addressed by #11214 |
When the tree is transformed into new blocks in
fastpathAcmpHelper
orlowerArrayStoreCHK
, the live locals info is not passed on from the previous block to the newly created blocks. The missing live locals causes missing GC map for the objects.Many thanks to @liqunl for finding the cause of the missing GC map.
Depends on:
Fixes #10869