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

Stackmap problems and solutions #1293

Open
ptersilie opened this issue Jul 9, 2024 · 0 comments
Open

Stackmap problems and solutions #1293

ptersilie opened this issue Jul 9, 2024 · 0 comments
Assignees

Comments

@ptersilie
Copy link
Contributor

ptersilie commented Jul 9, 2024

Issue to keep track of the problems we encountered with stackmaps and how we fixed them.

Function prologue

In order to recreate stackframes during deoptimisation we need information about the function prologue (e.g. callee-saved registers, pushed RBP), which LLVM's stackmap don't track. Fixed in ykjit/ykllvm#48

Extra locations

Live variables can live in multiple locations at the same time, while stackmaps only track one. Deopt requires putting back values in all their locations. Fixed in ykjit/ykllvm#57

Register allocator shifts stackmaps around

The register allocator may insert spill reloads inbetween function calls and their stackmap. This changes the address the stackmap is recording as well as the locations of live variables. Fixed in ykjit/ykllvm#61

Selection DAG changes instructions without updating stackmaps

When turning on optimisations, the Selection DAG may change instructions in a way that makes variables live that weren't at the time stackmaps were inserted, causing us to have untracked live variables. Current solution: disable optimisations during selection DAG.

Tracking things that get split across registers

llvm/llvm-project#55957 worked around in ykjit/ykllvm#40

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

3 participants