1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/DebugInfo
Vedant Kumar 55c3504da4 [LiveDebugValues] Encode register location within VarLoc IDs [3/3]
This is part 3 of a 3-part series to address a compile-time explosion
issue in LiveDebugValues.

---

Start encoding register locations within VarLoc IDs, and take advantage
of this encoding to speed up transferRegisterDef.

There is no fundamental algorithmic change: this patch simply swaps out
SparseBitVector in favor of CoalescingBitVector. That changes iteration
order (hence the test updates), but otherwise this patch is NFCI.

The only interesting change is in transferRegisterDef. Instead of doing:

```
KillSet = {}
for (ID : OpenRanges.getVarLocs())
  if (DeadRegs.count(ID))
    KillSet.add(ID)
```

We now do:

```
KillSet = {}
for (Reg : DeadRegs)
  for (ID : intervalsReservedForReg(Reg, OpenRanges.getVarLocs()))
    KillSet.add(ID)
```

By not visiting each open location every time we visit an instruction,
this eliminates some potentially quadratic behavior. The new
implementation basically does a constant amount of work per instruction
because the interval map lookups are very fast.

For a file in WebKit, this brings the time spent in LiveDebugValues down
from ~2.5 minutes to 4 seconds, reducing compile time spent in that pass
from 28% of the total to just over 1%.

Before:

```
2.49 min   27.8%	0 s	LiveDebugValues::process
2.41 min   27.0%	5.40 s	LiveDebugValues::transferRegisterDef
1.51 min   16.9%	1.51 min LiveDebugValues::VarLoc::isDescribedByReg() const
32.73 s    6.1%		8.70 s	 llvm::SparseBitVector<128u>::SparseBitVectorIterator::operator++()
```

After:

```
4.53 s	1.1%	0 s	LiveDebugValues::process
3.00 s	0.7%	107.00 ms		LiveDebugValues::transferRegisterCopy
892.00 ms	0.2%	406.00 ms	LiveDebugValues::transferSpillOrRestoreInst
404.00 ms	0.1%	32.00 ms	LiveDebugValues::transferRegisterDef
110.00 ms	0.0%	2.00 ms		  LiveDebugValues::getUsedRegs
57.00 ms	0.0%	1.00 ms		  std::__1::vector<>::push_back
40.00 ms	0.0%	1.00 ms		  llvm::CoalescingBitVector<>::find(unsigned long long)
```

FWIW, I tried the same approach using SparseBitVector, but got bad
results. To do that, I had to extend SparseBitVector to support 64-bit
indices and expose its lower bound operation. The problem with this is
that the performance is very hard to predict: SparseBitVector's lower
bound operation falls back to O(n) linear scans in a std::list if you're
not /very/ careful about managing iteration order. When I profiled this
the performance looked worse than the baseline.

You can see the full CoalescingBitVector-based implementation here:

  https://github.com/vedantk/llvm-project/commits/try-coalescing

You can see the full SparseBitVector-based implementation here:

  https://github.com/vedantk/llvm-project/commits/try-sparsebitvec-find

Depends on D74984 and D74985.

Differential Revision: https://reviews.llvm.org/D74986
2020-02-27 12:39:47 -08:00
..
AArch64 Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
AMDGPU [AMDGPU] Implement wave64 DWARF register mapping 2020-02-25 14:00:01 -05:00
ARM Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
COFF Revert "Revert "Reland "[Support] make report_fatal_error abort instead of exit""" 2020-02-13 10:16:06 -08:00
Generic Clean up hexagon builder after object-emission removal 2020-02-13 13:17:42 -06:00
Inputs Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
Lanai
Mips [MIPS][ELF] Use PC-relative relocations in .eh_frame when possible 2020-01-13 14:14:03 +00:00
MIR [LiveDebugValues] Encode register location within VarLoc IDs [3/3] 2020-02-27 12:39:47 -08:00
MSP430
NVPTX Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
PDB [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
PowerPC
RISCV [DebugInfo] Fix printing CIE offsets in EH FDEs. 2020-02-25 17:10:29 +07:00
Sparc Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
SystemZ [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
WebAssembly [WebAssembly] Replace all calls with generalized multivalue calls 2020-02-18 15:55:20 -08:00
X86 [DebugInfo] Fix printing CIE offsets in EH FDEs. 2020-02-25 17:10:29 +07:00
arange-overlap.test
arm-relocs.test
check-debugify-preserves-analyses.ll
cross-cu-inlining.test
cross-cu-scope.ll
debug-frame-cie-pointer-reloc.test [DebugInfo] Read CIE pointer as a relocatable value. 2020-02-20 09:12:05 +07:00
debugify-bogus-dbg-value.ll
debugify-each.ll
debugify-export.ll
debugify-report-missing-locs-only.ll
debugify.ll
debuglineinfo-macho.test
debuglineinfo-path.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
debuglineinfo.test
debugmacinfo-dwo.test [DebugInfo] Support for debug_macinfo.dwo section in llvm and llvm-dwarfdump. 2019-12-03 08:54:12 +05:30
debugmacinfo.test
dwarfdump-64-bit-dwarf.test [CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5 2019-04-29 18:34:18 +00:00
dwarfdump-accel.test
dwarfdump-bad-lookup-address.test [DWARF] check whether the DIE is valid before querying for information 2019-04-03 17:13:45 +00:00
dwarfdump-debug-frame-simple.test
dwarfdump-decompression-corrupt.test
dwarfdump-decompression-error.test
dwarfdump-dump-flags.test
dwarfdump-dump-gdbindex.test [llvm-dwarfdump] --gdb-index: fix uninitialized TuListOffset 2019-06-19 13:51:29 +00:00
dwarfdump-dwp.test
dwarfdump-implicit-const.test
dwarfdump-invalid.test
dwarfdump-macho-relocs.test
dwarfdump-macho-universal.test
dwarfdump-objc.test
dwarfdump-pubnames.test
dwarfdump-ranges.test
dwarfdump-type-units.test
dwarfdump-zlib.test
dwo.ll
gcc-local-mem-func.test
high-pc-constant.test
invalid-relocations.test [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
macro_link.ll
member-pointers.o
missing-abstract-variable.o
omit-empty.ll
pr34186.ll
pr34672.ll
pr37964.ll [Transforms][Debugify] Ignore PHI nodes when checking for DebugLocs 2020-02-27 16:14:11 +00:00
precomp.test [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
salvage-cast-debug-info.ll Reapply: [DebugInfo] Correctly handle salvaged casts and split fragments at ISel 2019-12-18 16:26:42 +00:00
skeletoncu.ll
strip-DIGlobalVariable.ll
strip-loop-metadata.ll
strip-module-flags.ll
symbolize-64bit-address.test
symbolize-absolute-path-in-debug-line.s
symbolize-build-id-error.test [Symbolize] Handle error after the notes loop 2020-01-27 11:00:27 -08:00
symbolize-build-id.test [llvm-symbolizer] Support debug file lookup using build ID 2019-12-04 15:07:56 -08:00
symbolize-demangling.s
symbolize-directory.s Fix more Windows bots after r360015. 2019-05-06 19:12:25 +00:00
symbolize-gnu-debuglink-fallback.test
symbolize-gnu-debuglink-no-realpath.test
symbolize-gnu-debuglink.test
symbolize-inlined.test [test][tools] Add missing and improve testing 2019-12-09 12:24:23 +00:00
symbolize-macho-universal-unknown-arch.test
symbolize-macho-universal.test
symbolize-missing-file.test
symbolize-no-debug-str.test
symbolize-paths.s attempt to fix symbolize-paths.s everywhere after cd68f4 2020-01-29 14:26:50 -05:00
symbolize-shared-abbrev.s
symbolize-split-dwarf-empty.test
symbolize-split-dwarf-no-skel-address.test
symbolize-stripped-sections.test
symbolize-stripped.test
symbolize-tu.test
symbolize-zlib.test
symbolize.test
typeunit-header.test
unrolled-loop-remainder.ll