[PATCH] D114587: [DebugInfo][InstrRef] Avoid some quadratic behaviour in LiveDebugVariables

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 25 07:32:15 PST 2021


StephenTozer accepted this revision.
StephenTozer added a comment.
This revision is now accepted and ready to land.

Looks like a plain and simple performance improvement, LGTM (one minor nit included).



================
Comment at: llvm/lib/CodeGen/LiveDebugVariables.cpp:1899
+      while (NextItem != StashedDebugInstrs.end() && NextItem->Idx == Idx) {
+        assert(NextItem->MBB == MBB);
+        MBB->insert(InsertPos, NextItem->MI);
----------------
Minor nit, might be worth just adding a small string here (`&& "Instrs with the same slot index should be in the same MBB"` or something along those lines)? Feel free to ignore if you think it's unnecessary though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114587/new/

https://reviews.llvm.org/D114587



More information about the llvm-commits mailing list