[PATCH] D80662: [LiveDebugValues] Add cutoffs to avoid pathological behavior

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 14:10:47 PDT 2020


vsk created this revision.
vsk added reviewers: aprantl, friss, jmorse, Orlando.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

We received a report of LiveDebugValues consuming 25GB+ of RAM when
compiling code generated by Unity's IL2CPP scripting backend.

There's an initial 5GB spike due to repeatedly copying cached lists of
MachineBasicBlocks within the UserValueScopes members of VarLocs.

But the larger scaling issue arises due to the fact that prior to range
extension, there are 81K basic blocks and 156K DBG_VALUEs: given enough
memory, LiveDebugValues would insert 101 million MIs (I counted this by
incrementing a counter inside of VarLoc::BuildDbgValue).

It seems like LiveDebugValues would have to be rearchitected to support
this kind of input (we'd need some new represntation for DBG_VALUEs that
get inserted into ~every block via flushPendingLocs). OTOH, large globs
of auto-generated code are typically not debugged interactively.

So: add cutoffs to disable range extension when the input is too big. I
chose the cutoffs experimentally, erring on the conservative side. When
compiling a large collection of Apple software, range extension never
got disabled.

rdar://63418929


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80662

Files:
  llvm/lib/CodeGen/LiveDebugValues.cpp
  llvm/test/DebugInfo/MIR/X86/live-debug-values-cutoffs.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80662.266661.patch
Type: text/x-patch
Size: 6524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/3016fc3b/attachment.bin>


More information about the llvm-commits mailing list