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

i#5121: Add test for insertion phase respill after app2app restore #5124

Merged
merged 7 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ext/drreg/drreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,16 +500,16 @@ drreg_insert_restore_all(void *drcontext, instrlist_t *bb, instr_t *inst,
/* Before each app read, or at end of bb, restore spilled registers to app values.
* XXX i#5121: For regs that are in spilled state at this instr also during the
* app2app phase, the following does not restore the app value, it restores the
* app2app meta value instead. This is expected and correct, because the drreg use
* in insertion phase adds spills/restores around the drreg spills/restores from
* previous phases like they were app instrs. So, the app2app meta value is no
* different than the app value for the insertion phase.
* app2app meta value instead. This is expected and correct, because drreg in
* insertion phase adds spills/restores around the drreg spills/restores from the
* previous phases like they were app instrs. So, the app2app meta value is treated
* like an app value by the insertion phase.
abhinav92003 marked this conversation as resolved.
Show resolved Hide resolved
*
* For cases where we really want the app value at some point in the insertion phase,
* e.g. for use with annotations, or for user-added calls to drreg_get_app_value and
* drreg_statelessly_restore_app_value to work as expected, the user needs to restore
* the app value at the same point in the app2app phase also. This aligns with other
* similar expectations from the user for non-insertion phase use of drreg, like
* For cases where instrumentation wants the app value at some point in the insertion,
abhinav92003 marked this conversation as resolved.
Show resolved Hide resolved
* phase e.g. for use with annotations, or for user-added calls to drreg_get_app_value
abhinav92003 marked this conversation as resolved.
Show resolved Hide resolved
* and drreg_statelessly_restore_app_value to work as expected, the user needs to
* restore the app value at the same point in the app2app phase also. This aligns with
* other similar expectations from the user for non-insertion phase use of drreg, like
* manually restoring/re-spilling around app reads and writes, which happens
abhinav92003 marked this conversation as resolved.
Show resolved Hide resolved
* automatically only in the insertion phase.
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/drreg/drreg.dox
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ transformation phase, or use outside of \p drmgr entirely, is supported,
but duplicate spills and restores may not be optimized away. Also, for
non-insertion phases, the responsibility to restore a spilled app value
before certain instructions like an app read or a label with the note
DR_NOTE_ANNOTATION, and to re-spill the app value after an app write, lies
#DR_NOTE_ANNOTATION, and to re-spill the app value after an app write, lies
with the user; in the insertion phase, this is done automatically, but it
needs to be done manually in non-insertion phases. When using
abhinav92003 marked this conversation as resolved.
Show resolved Hide resolved
drreg to reserve registers in multiple phases (like app2app or
Expand Down