[all-commits] [llvm/llvm-project] e048ea: [NFC][DebugInfo] Create InstructionOrdering helper...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Thu Aug 27 04:14:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e048ea7b1a05793df86b931b43faeacf2ae7373d
      https://github.com/llvm/llvm-project/commit/e048ea7b1a05793df86b931b43faeacf2ae7373d
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp

  Log Message:
  -----------
  [NFC][DebugInfo] Create InstructionOrdering helper class (1/4)

Group the map and methods used to query instruction ordering for trimVarLocs
(D82129) into a class. This will make it easier to reuse the functionality
upcoming patches.

Reviewed By: aprantl

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


  Commit: 0b5a8050ea39355a3876cc6bba9383d91e224e1f
      https://github.com/llvm/llvm-project/commit/0b5a8050ea39355a3876cc6bba9383d91e224e1f
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
    M llvm/include/llvm/CodeGen/DebugHandlerBase.h
    M llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
    M llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir
    M llvm/test/DebugInfo/MIR/X86/callsite-stack-value.mir
    A llvm/test/DebugInfo/X86/single-location-2.mir
    M llvm/test/DebugInfo/X86/trim-var-locs.mir

  Log Message:
  -----------
  [DwarfDebug] Improve single location detection in validThroughout (2/4)

With this patch we're now accounting for two more cases which should be
considered 'valid throughout': First, where RangeEnd is ScopeEnd. Second, where
RangeEnd comes before ScopeEnd when including meta instructions, but are both
preceded by the same non-meta instruction.

CTMark shows a geomean binary size reduction of 1.5% for RelWithDebInfo builds.
`llvm-locstats` (using D85636) shows a very small variable location coverage
change in 2 of 10 binaries, but it is in the order of 10s of bytes which lines
up with my expectations.

I've added a test which checks both of these new cases. The first check in the
test isn't strictly necessary for this patch. But I'm not sure that it is
explicitly tested anywhere else, and is useful for the final patch in the
series.

Reviewed By: aprantl

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


  Commit: 3c491881d2aedf8d305e6ebb6db135ed19cee3a0
      https://github.com/llvm/llvm-project/commit/3c491881d2aedf8d305e6ebb6db135ed19cee3a0
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/test/DebugInfo/AArch64/inlined-argument.ll
    A llvm/test/DebugInfo/X86/location-range-inlined-xblock.mir

  Log Message:
  -----------
  [DwarfDebug] Improve multi-BB single location detection in validThroughout (3/4)

With the changes introduced in D86151 we can now check for single locations
which span multiple blocks for inlined scopes and blocks.

D86151 introduced the InstructionOrdering parameter, replacing a scan through
MBB instructions. The functionality to compare instruction positions across
blocks was add there, and this patch just removes the exit checks that were
previously (but no longer) required.

CTMark shows a geomean binary size reduction of 2.2% for RelWithDebInfo builds.
llvm-locstats (using D85636) shows a very small variable location coverage
change in 5 of 10 binaries, but just like in D86151 it is only in the order of
10s of bytes.

Reviewed By: djtodoro

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


  Commit: 57d8acac64b87cb4286b00485fb2da7521fc091e
      https://github.com/llvm/llvm-project/commit/57d8acac64b87cb4286b00485fb2da7521fc091e
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/test/DebugInfo/X86/inlined-formal-parameter.ll

  Log Message:
  -----------
  [DwarfDebug] Improve validThroughout performance (4/4)

Almost NFC (see end).

The backwards scan in validThroughout significantly contributed to compile time
for a pathological case, causing the 'X86 Assembly Printer' pass to account for
roughly 70% of the run time. This patch guards the loop against running
unnecessarily, bringing the pass contribution down to 4%.

Almost NFC: There is a hack in validThroughout which promotes single constant
value DBG_VALUEs in the prologue to be live throughout the function. We're more
likely to hit this code path with this patch applied. Similarly to the parent
patches there is a small coverage change reported in the order of 10s of bytes.

Reviewed By: aprantl

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


  Commit: b6cca0ec05cfc48f59628f6c4c076756b839f4a2
      https://github.com/llvm/llvm-project/commit/b6cca0ec05cfc48f59628f6c4c076756b839f4a2
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    R llvm/test/DebugInfo/MIR/X86/singlelocation-cutoffs.mir

  Log Message:
  -----------
  Revert "[DWARF] Add cuttoff guarding quadratic validThroughout behaviour"

This reverts commit b9d977b0ca60c54f11615ca9d144c9f08b29fd85.

This cutoff is no longer required. The commit 34ffa7fc501 (D86153) introduces a
performance improvement which was tested against the motivating case for this
patch.

Discussed in differential revision: https://reviews.llvm.org/D86153


Compare: https://github.com/llvm/llvm-project/compare/feed5a7239d8...b6cca0ec05cf


More information about the All-commits mailing list