[all-commits] [llvm/llvm-project] 0aa201: [MachineLICM] Assert that locations from debug ins...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Thu May 28 13:54:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0aa201eaf97681f59b72baee6552aa1b9b5c9129
      https://github.com/llvm/llvm-project/commit/0aa201eaf97681f59b72baee6552aa1b9b5c9129
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineLICM.cpp

  Log Message:
  -----------
  [MachineLICM] Assert that locations from debug insts are not lost

Summary:
Assert that MachineLICM does not move a debug instruction and then drop
its debug location. Later passes require each debug instruction to have
a location.

Testing: check-llvm, clang stage2 RelWithDebInfo build (x86_64)

Reviewers: aprantl, davide, chrisjackson, jmorse

Subscribers: hiraditya, asbirlea, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80665


  Commit: 4855534d10cea3dd93d33da13ceb3381b0c588e6
      https://github.com/llvm/llvm-project/commit/4855534d10cea3dd93d33da13ceb3381b0c588e6
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineVerifier.cpp
    M llvm/test/CodeGen/Hexagon/early-if-debug.mir
    A llvm/test/CodeGen/MIR/Generic/dbg-value-missing-loc.mir
    M llvm/test/CodeGen/MIR/X86/instructions-debug-location.mir
    M llvm/test/CodeGen/MIR/X86/metadata-operands.mir
    M llvm/test/CodeGen/RISCV/select-optimize-multiple.mir
    M llvm/test/CodeGen/X86/machine-cp-debug.mir
    M llvm/test/CodeGen/X86/pr38952.mir

  Log Message:
  -----------
  [MachineVerifier] Verify that a DBG_VALUE has a debug location

Summary:
Verify that each DBG_VALUE has a debug location. This is required by
LiveDebugValues, and perhaps by other late passes.

There's an exception for tests: lots of tests use a two-operand form of
DBG_VALUE for convenience. There's no reason to prevent that.

This is an extension of D80665, but there's no dependency.

Reviewers: aprantl, jmorse, davide, chrisjackson

Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80670


  Commit: d11155d273af00f75c2b40a5ca3007463f9808c1
      https://github.com/llvm/llvm-project/commit/d11155d273af00f75c2b40a5ca3007463f9808c1
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues.cpp
    A llvm/test/DebugInfo/MIR/X86/live-debug-values-cutoffs.mir

  Log Message:
  -----------
  [LiveDebugValues] Add cutoffs to avoid pathological behavior

Summary:
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

Reviewers: aprantl, friss, jmorse, Orlando

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80662


Compare: https://github.com/llvm/llvm-project/compare/9d065477942f...d11155d273af


More information about the All-commits mailing list