[all-commits] [llvm/llvm-project] fc93ba: [GlobalISel][DebugInfo] Remove debug info with zer...
David Blaikie via All-commits
all-commits at lists.llvm.org
Mon Jul 25 10:19:23 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fc93ba061aa05a428057e7a7753128f27af0dd41
https://github.com/llvm/llvm-project/commit/fc93ba061aa05a428057e7a7753128f27af0dd41
Author: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: 2022-07-25 (Mon, 25 Jul 2022)
Changed paths:
M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
M llvm/test/CodeGen/AArch64/GlobalISel/combine-shift-of-shifted-dbg-value-fallback.ll
M llvm/test/CodeGen/AArch64/GlobalISel/constant-dbg-loc.ll
Log Message:
-----------
[GlobalISel][DebugInfo] Remove debug info with zero line from constants inserted at entry block
Emission of constants having DebugLoc with line 0 causes significant increase of debug_line section size for some source files.
To illustrate, we can compare section sizes of several files from llvm test-suite, built with SelectionDAG vs GlobalISel, on Aarch64 (macOS), using -O0 optimization level:
| Source path | SDAG text sz | GISel text sz | SDAG debug_line sz | GISel debug_line sz
| -------------------------------------------------------------- | ------------ | ------------- | ------------------ | --------------------
| `SingleSource/Regression/C/gcc-c-torture/execute/strlen-2.c` | 15320 | 660 | 14872 | 6340
| `SingleSource/Regression/C/gcc-c-torture/execute/20040629-1.c` | 33640 | 26300 | 2812 | 6693
| `SingleSource/Benchmarks/Misc/flops-4.c` | 1428 | 1196 | 594 | 1008
| `MultiSource/Benchmarks/MiBench/consumer-typeset/z31.c` | 2716 | 964 | 809 | 903
| `MultiSource/Benchmarks/Prolangs-C/gnugo/showinst.c` | 2534 | 2502 | 189 | 573
For instance, here is a fragment of `flops-4.c.o` debug line section dump
```
Address Line Column File ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000 174 0 1 0 0 is_stmt
0x0000000000000010 0 0 1 0 0
0x0000000000000018 185 4 1 0 0 is_stmt prologue_end
0x000000000000001c 0 0 1 0 0
0x0000000000000024 186 4 1 0 0 is_stmt
0x000000000000002c 189 10 1 0 0 is_stmt
0x0000000000000030 0 0 1 0 0
0x0000000000000038 207 11 1 0 0 is_stmt
0x0000000000000044 208 11 1 0 0 is_stmt
0x0000000000000048 0 0 1 0 0
0x0000000000000058 210 10 1 0 0 is_stmt
0x000000000000005c 0 0 1 0 0
0x0000000000000060 211 10 1 0 0 is_stmt
0x0000000000000064 0 0 1 0 0
0x000000000000006c 212 10 1 0 0 is_stmt
0x0000000000000070 0 0 1 0 0
0x000000000000007c 213 10 1 0 0 is_stmt
0x0000000000000080 0 0 1 0 0
0x0000000000000088 214 10 1 0 0 is_stmt
0x000000000000008c 0 0 1 0 0
0x0000000000000094 215 10 1 0 0 is_stmt
```
Lot of zero lines are produced by constants (global values) having DebugLoc with line 0.
It seems that they're not significant for debugging experience.
With the commit applied, total size of debug_line sections of llvm shared libraries has reduced by 2.5%.
Change of debug line section size of files listed above:
| Source path | GISel debug_line sz | Patch debug_line sz
| -------------------------------------------------------------- | ------------------- | --------------------
| `SingleSource/Regression/C/gcc-c-torture/execute/strlen-2.c` | 6340 | 1465
| `SingleSource/Regression/C/gcc-c-torture/execute/20040629-1.c` | 6693 | 3782
| `SingleSource/Benchmarks/Misc/flops-4.c` | 1008 | 609
| `MultiSource/Benchmarks/MiBench/consumer-typeset/z31.c` | 903 | 841
| `MultiSource/Benchmarks/Prolangs-C/gnugo/showinst.c` | 573 | 190
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127488
More information about the All-commits
mailing list