-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Revamps the drreg state restoration logic in drreg_event_restore_state to correctly handle various corner cases like multiple restores (i#4939), multiple spills, aflags in reg (i#4933), multi-phase use (i#3823) leading to nested or otherwise overlapping spill regions, and app instrs that look like drreg spill/restore instrs. Makes the reconstructed ilist available to drreg_event_restore_state (i#3801). The additional metadata that is used by the new logic is only whether an instr is an app or meta instr. For cases when the reconstructed ilist is not available, we continue to use the old best-effort logic. Highlighted its caveats in comments. The new logic looks at the complete ilist to track the movement of the app value of gprs/aflags across spills and restores. The native value can be in the gpr/aflags itself or one or more spill slots. We do not forget a spill slot on seeing one restore (which caused i#4939), but remember that the app value can still be found in the spill slot, in addition to the gpr itself. Instead, a spill slot is forgotten when it is used to spill some other reg or if there's an app instr that writes to the spilled gpr/aflags. We also track whether gprs/aflags contain their native app value or not. This helps in handling cases of overlapping or nested spill regions arising out of multi-phase use of drreg. Tool writes (except restores) to gprs/aflags clobber the native value. App writes to gprs/aflags install a native value and invalidate the value in the gpr's/aflags' spill slot. Restores from spill slots also install a native value. Adds tests for multi-phase gpr reservation cases (nested/overlapping spill regions), multiple spills for gpr and multiple restores for gpr. Tests for these scenarios for aflags will be added when multi-phase drreg support is added for aflags. Tracks movement of aflags to registers more robustly to fix i#4933. Also adds a test for this case. Avoids confusing app instrs that write using the stolen reg on AArch64 with drreg spill or restore instrs. Also adds a test that verifies this fix. Adds documentation about faulting fragment's reconstructed ilist being available in restore state event callbacks. Issue: #4933, #4939, #3823, #3801 Fixes: #4933 Fixes: #4939
- Loading branch information
1 parent
4b6d1ca
commit f62441b
Showing
10 changed files
with
1,037 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.