Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
30845e8a |
| 23-Jan-2024 |
Stephen Tozer <stephen.tozer@sony.com> |
[RemoveDIs][DebugInfo] Handle DPVAssigns in Assignment Tracking excluding lowering (#78982)
This patch adds support for DPVAssigns across all of
AssignmentTrackingAnalysis except for AssignmentTrac
[RemoveDIs][DebugInfo] Handle DPVAssigns in Assignment Tracking excluding lowering (#78982)
This patch adds support for DPVAssigns across all of
AssignmentTrackingAnalysis except for AssignmentTrackingLowering, which
is implemented in a separate patch. This patch includes handling
DPValues in MemLocFragFill, the removal of redundant DPValues as part of
AssignmentTrackingAnalysis (which is different to the version in
`BasicBlockUtils.cpp`), and preventing the DPVAssigns from being
directly emitted in SelectionDAG (just as we don't emit llvm.dbg.assigns
directly, but receive a set of locations from
AssignmentTrackingAnalysis' output).
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init |
|
#
4ece5073 |
| 20-Jan-2023 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking][NFC] Replace LLVM command line option with a module flag
Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is still enabled from Clang with the command li
[Assignment Tracking][NFC] Replace LLVM command line option with a module flag
Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is still enabled from Clang with the command line -Xclang -fexperimental-assignment-tracking which tells Clang to ask LLVM to run the pass declare-to-assign. That pass converts conventional debug intrinsics to assignment tracking metadata. With this patch it now also sets a module flag debug-info-assignment-tracking with the value `i1 true` (using the flag conflict rule `Max` since enabling assignment tracking on IR that contains only conventional debug intrinsics should cause no issues).
Update the docs and tests too.
Reviewed By: CarlosAlbertoEnciso
Differential Revision: https://reviews.llvm.org/D142027
show more ...
|
#
3af113f3 |
| 18-Jan-2023 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking] Replace metadata number with variable capture in tests
|
Revision tags: llvmorg-15.0.7 |
|
#
1d1de746 |
| 09-Dec-2022 |
OCHyams <orlando.hyams@sony.com> |
[Assignment Tracking][Analysis] Add analysis pass
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifyin
[Assignment Tracking][Analysis] Add analysis pass
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/ rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Add initial revision of assignment tracking analysis pass --------------------------------------------------------- This patch squashes five individually reviewed patches into one:
#1 https://reviews.llvm.org/D136320 #2 https://reviews.llvm.org/D136321 #3 https://reviews.llvm.org/D136325 #4 https://reviews.llvm.org/D136331 #5 https://reviews.llvm.org/D136335
Patch #1 introduces 2 new files: AssignmentTrackingAnalysis.h and .cpp. The two subsequent patches modify those files only. Patch #4 plumbs the analysis into SelectionDAG, and patch #5 is a collection of tests for the analysis as a whole.
The analysis was broken up into smaller chunks for review purposes but for the most part the tests were written using the whole analysis. It would be possible to break up the tests for patches #1 through #3 for the purpose of landing the patches seperately. However, most them would require an update for each patch. In addition, patch #4 - which connects the analysis to SelectionDAG - is required by all of the tests.
If there is build-bot trouble, we might try a different landing sequence.
Analysis problem and goal -------------------------
Variables values can be stored in memory, or available as SSA values, or both. Using the Assignment Tracking metadata, it's not possible to determine a variable location just by looking at a debug intrinsic in isolation. Instructions without any metadata can change the location of a variable. The meaning of dbg.assign intrinsics changes depending on whether there are linked instructions, and where they are relative to those instructions. So we need to analyse the IR and convert the embedded information into a form that SelectionDAG can consume to produce debug variable locations in MIR.
The solution is a dataflow analysis which, aiming to maximise the memory location coverage for variables, outputs a mapping of instruction positions to variable location definitions.
API usage ---------
The analysis is named `AssignmentTrackingAnalysis`. It is added as a required pass for SelectionDAGISel when assignment tracking is enabled.
The results of the analysis are exposed via `getResults` using the returned `const FunctionVarLocs *`'s const methods:
const VarLocInfo *single_locs_begin() const; const VarLocInfo *single_locs_end() const; const VarLocInfo *locs_begin(const Instruction *Before) const; const VarLocInfo *locs_end(const Instruction *Before) const; void print(raw_ostream &OS, const Function &Fn) const;
Debug intrinsics can be ignored after running the analysis. Instead, variable location definitions that occur between an instruction `Inst` and its predecessor (or block start) can be found by looping over the range:
locs_begin(Inst), locs_end(Inst)
Similarly, variables with a memory location that is valid for their lifetime can be iterated over using the range:
single_locs_begin(), single_locs_end()
Further detail --------------
For an explanation of the dataflow implementation and the integration with SelectionDAG, please see the reviews linked at the top of this commit message.
Reviewed By: jmorse
show more ...
|