-
Notifications
You must be signed in to change notification settings - Fork 24
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
Create proof trace event for tail call information #1179
base: develop
Are you sure you want to change the base?
Conversation
35e6e56
to
b4c6344
Compare
function exited with a tail call
39656e2
to
bdfceba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple low-level comments that I highlighted in the diff, but also one higher level comment: tail call info feels like a weird name for the event when it is emitted even in functions with no tail call. What if we just call it a function exit event?
lib/codegen/ProofEvent.cpp
Outdated
@@ -372,13 +392,42 @@ std::pair<llvm::BasicBlock *, llvm::BasicBlock *> proof_event::proof_branch( | |||
return {true_block, merge_block}; | |||
} | |||
|
|||
std::pair<llvm::BasicBlock *, llvm::BasicBlock *> proof_event::proof_branch( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels pretty copy-pasted; is there a way we could separate out a more generic function? maybe using templates?
include/kllvm/codegen/ProofEvent.h
Outdated
@@ -228,6 +239,10 @@ class proof_event { | |||
[[nodiscard]] llvm::BasicBlock *pattern_matching_failure( | |||
kore_composite_pattern const &pattern, llvm::BasicBlock *current_block); | |||
|
|||
[[nodiscard]] llvm::BasicBlock *tail_call_info( | |||
std::string const &caller_name, bool is_tail, | |||
llvm::Instruction *insert_before, llvm::BasicBlock *current_block); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't really need both insert_before and current_block, right? could we change this signature so that you pass one or the other?
…rule ordinals in function exit events
@dwightguth I addressed your comments. Could you take another look? |
This PR adds a new event that provides information on the way a function exits control, specifically whether it exits via a tail call or a conventional return statement. This event is added to assist in computing the call stack of the various simplifications from the proof trace hint.