[all-commits] [llvm/llvm-project] 9fd9d5: [DebugInfo][InstrRef][NFC] Use depth-first scope s...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Wed Feb 2 06:10:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fd9d56dc6bdeeddf8cf2af834c6c39d00cd7244
      https://github.com/llvm/llvm-project/commit/9fd9d56dc6bdeeddf8cf2af834c6c39d00cd7244
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

  Log Message:
  -----------
  [DebugInfo][InstrRef][NFC] Use depth-first scope search for variable locs

This patch aims to reduce max-rss from instruction referencing, by avoiding
keeping variable value information in memory for too long. Instead of
computing all the variable values then emitting them to DBG_VALUE
instructions, this patch tries to stream the information out through a
depth first search:
 * Make use of the fact LexicalScopes gives a depth-number to each lexical
   scope,
 * Produce a map that identifies the last lexical scope to make use of a
   block,
 * Enumerate each scope in LexicalScopes' DFS order, solving the variable
   value problem,
 * After each scope is processed, look for any blocks that won't be used by
   any other scope, and emit all the variable information to DBG_VALUE
   instructions.

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




More information about the All-commits mailing list