[all-commits] [llvm/llvm-project] 310708: [DebugInfo][InstrRef] Avoid some quadratic behavio...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Thu Nov 25 12:31:19 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3107081e941379bf62c02543c7396ad01349edc4
      https://github.com/llvm/llvm-project/commit/3107081e941379bf62c02543c7396ad01349edc4
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2021-11-25 (Thu, 25 Nov 2021)

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

  Log Message:
  -----------
  [DebugInfo][InstrRef] Avoid some quadratic behaviour in LiveDebugVariables

This is a performance patch -- LiveDebugVariables can behave quadratically
if a lot of debug instructions are inserted back into the same place, and
we have to repeatedly step-over hte ones we've already inserted.

To get around it, whenever we insert a debug instruction at a slot index,
check whether there are more debug instructions to insert at this point,
and insert them too. That avoids the repeated lookup and stepping through.
It relies on the container for unlinked debug instructions being recorded
in-order, which is how LiveDebugVariables currently does it.

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




More information about the All-commits mailing list