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

Add a feature to clobber non-callee-save regs in the prolog/epilog or clobber dead callee-saves around call sites. #19641

Open
atrick opened this issue Mar 27, 2014 · 2 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@atrick
Copy link
Contributor

atrick commented Mar 27, 2014

Bugzilla Link 19267
Version trunk
OS All
CC @ributzka,@pageexec,@rnk

Extended Description

Pretty simple. Just write some trash value into all registers in the prolog that aren't preserved by the function's calling convention.

We can add a function attribute to control this.
This feature could help stress test things like

  • liveness across call site
  • a managed runtime that saves/restores context around calls to native code
  • the stack map liveness feature that reports

In the case of stackmap liveness, we could clobber dead registers at the point of the stackmap to verify our own analysis. This would be a more direct way to verify the liveness analysis.

There is some speculation that this could harden code against security vulnerabilities, but I haven't confirmed that.

For my immediate goals, verification in the runtime may be sufficient. But I want to float the idea early of having LLVM generate clobber regs to get input from others.

@atrick
Copy link
Contributor Author

atrick commented Mar 28, 2014

To be clear, we can do this
(a) in the prolog for all caller-saves
(b) in the epilog for all caller-saves
(c) around call sites for dead callee-saves

@rnk
Copy link
Collaborator

rnk commented Mar 28, 2014

FWIW, V8 and lots of JITs do this in debug modes, so it seems useful to me.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants