Skip to content
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

Fix up liveness info broken by post-GRA CFG manipulation #10981

Open
liqunl opened this issue Oct 23, 2020 · 1 comment
Open

Fix up liveness info broken by post-GRA CFG manipulation #10981

liqunl opened this issue Oct 23, 2020 · 1 comment

Comments

@liqunl
Copy link
Contributor

liqunl commented Oct 23, 2020

This issue is created based on discussion on #10976
#10976 (comment)
#10976 (comment)

GRA runs liveness analysis to get local liveness, and use it to assign regiesters. The local liveness info is stored in block, and is used by codegen in gc map computation.

However, post-GRA transformations will manipulate CFG and break the liveness info, resulting in bad gc map. A gc map related defect is hard to debug, and it's not obvious for a JIT developer to know the dependency between GRA and gc map correctness.

We can either

  1. Run liveness info in codegen. However, optimizer has shutdown in codegen, liveness analysis may not work at this stage
  2. Fix up liveness info manually in places that manupulates CFG. This should work for simple CFG manipulation, transformations that only expands a tree/block to several blocks. Places that manipulate CFG include the following
    a. acmp helper and array store check lowering
    b. jprofiling
  3. If 1 and 2 are not possible, we should invalidate liveness info. This will cause codegen to conservatively compute gc map for locals: locals with collected reference will be live on all gc points.

We should try 1 as it is the simplest approach if works. 3 may have performance impact as it will prolong local liveness.

@liqunl
Copy link
Contributor Author

liqunl commented Oct 27, 2020

#10976 (comment) tried 1, and there are problems running liveness analysis in codegen.
So we should try 2 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant