[PATCH] D111799: [DebugInfo][InstrRef] Improve compile-time performance by handling a single variable at a time

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 05:48:56 PDT 2021


jmorse created this revision.
jmorse added reviewers: StephenTozer, Orlando, TWeaver.
Herald added a subscriber: hiraditya.
jmorse requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Here's another performance patch for InstrRefBasedLDV: rather than processing all variable values in a scope at a time, instead, process one variable at a time. The benefits are twofold:

- It's easier to reason about one variable at a time in your mind,
- This recovers some recent lost performance [0].

I think the performance benefit comes from less work being done: if there are several variables in a lexical scope, and only one of them has a value that changes, then all them get reprocessed. This way we're keeping the locality benefits, but doing less work. Plus, we're dealing with fewer DenseMap lookups.

The downside is that the value-propagation part of variable value calculations is now indented one level further., plus the unit tests all get re-written a bit.

[0] http://llvm-compile-time-tracker.com/compare.php?from=2ce3f528481305be8dd0da344f9f95c41da354ad&to=07fdd77e4557692f3a9ca5a8f4f20a92e36a3b2b&stat=instructions


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111799

Files:
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
  llvm/unittests/CodeGen/InstrRefLDVTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111799.379679.patch
Type: text/x-patch
Size: 57281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/715cd92e/attachment-0001.bin>


More information about the llvm-commits mailing list