Skip to content

Commit b6a4ab5

Browse files
authored
[NFC] Fix llvm#106873 - update assignment tracking docs (llvm#106959)
1 parent e5c7cde commit b6a4ab5

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

llvm/docs/AssignmentTracking.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ LLVM pass writers, and minimal disruption to LLVM in general.
2020

2121
## Status and usage
2222

23-
**Status**: Experimental work in progress. Enabling is strongly advised against
24-
except for development and testing.
23+
**Status**: Enabled by default in Clang but disabled under some circumstances
24+
(which can be overridden with the `forced` option, see below). `opt` will not
25+
run the pass unless asked (`-passes=declare-to-assign`).
2526

26-
**Enable in Clang**: `-Xclang -fexperimental-assignment-tracking`
27+
**Flag**:
28+
`-Xclang -fexperimental-assignment-tracking=<disabled|enabled|forced>`
2729

28-
That causes Clang to get LLVM to run the pass `declare-to-assign`. The pass
30+
When enabled Clang gets LLVM to run the pass `declare-to-assign`. The pass
2931
converts conventional debug records to assignment tracking metadata and sets
3032
the module flag `debug-info-assignment-tracking` to the value `i1 true`. To
3133
check whether assignment tracking is enabled for a module call
@@ -88,7 +90,7 @@ int fun(int a) {
8890
```
8991
compiled without optimisations:
9092
```
91-
$ clang++ test.cpp -o test.ll -emit-llvm -S -g -O0 -Xclang -fexperimental-assignment-tracking
93+
$ clang++ test.cpp -o test.ll -emit-llvm -S -g -O0 -Xclang -fexperimental-assignment-tracking=enabled
9294
```
9395
we get:
9496
```
@@ -194,8 +196,7 @@ the choice at each instruction, iteratively joining the results for each block.
194196

195197
### TODO list
196198

197-
As this is an experimental work in progress so there are some items we still need
198-
to tackle:
199+
Outstanding improvements:
199200

200201
* As mentioned in test llvm/test/DebugInfo/assignment-tracking/X86/diamond-3.ll,
201202
the analysis should treat escaping calls like untagged stores.
@@ -228,3 +229,8 @@ to tackle:
228229
that we can only track assignments with fixed offsets and sizes, I think we
229230
can probably get rid of the address and address-expression part, since it
230231
will always be computable with the info we have.
232+
233+
* Assignment tracking is disabled by default for LTO and thinLTO builds, and
234+
if LLDB debugger tuning has been specified. We should remove these
235+
restrictions. See EmitAssemblyHelper::RunOptimizationPipeline in
236+
clang/lib/CodeGen/BackendUtil.cpp.

0 commit comments

Comments
 (0)