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

WIP: Heapster/source hints #1633

Merged
merged 6 commits into from
Apr 29, 2022
Merged

WIP: Heapster/source hints #1633

merged 6 commits into from
Apr 29, 2022

Conversation

abakst
Copy link
Contributor

@abakst abakst commented Apr 21, 2022

Adds a mechanism to specify Heapster block-entry hints in LLVM IR. The hints are automatically extracted by the heapster_typecheck_fun SAW command and added to the perm env.

A basic block should include a call to void (...) @heapster.require like so:

@.ghosts = private unnamed_addr constant [42 x i8] c"frm:llvmframe 64,a:llvmptr 64,b:llvmptr 64", align 1
@.spec = private unnamed_addr constant [90 x i8] c"arg0:eq(top1),arg1:eq(top0),top1:true,top0:ptr((R,0) |-> eq(arg0)),frm:llvmframe [b:8,a:8]", align 1

...

  call void (...) @heapster.require(
    i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.ghosts, i64 0, i64 0),
    i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.spec, i64 0, i64 0),
    i64 %1,
    i64* %0
  )
  • The first argument is a ghost context. The names here can be arbitrary
  • The second argument is a list of value permissions. The names bound should be arg0 ... argN. Permissions can also be assigned to ghosts defined in the ghost context, or toplevels via the names top0...topM
  • The remaining arguments are the llvm instructions to substitute for each argi, i.e. the in the above, use %1 for arg0, %2 for arg1.

@abakst abakst self-assigned this Apr 21, 2022
@abakst abakst requested a review from eddywestbrook April 21, 2022 23:29
Copy link
Contributor

@eddywestbrook eddywestbrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eddywestbrook eddywestbrook added PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run subsystem: heapster Issues specifically related to memory verification using Heapster labels Apr 29, 2022
@mergify mergify bot merged commit 348c9ef into master Apr 29, 2022
@mergify mergify bot deleted the heapster/source-hints branch April 29, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run subsystem: heapster Issues specifically related to memory verification using Heapster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants