[PATCH] D117162: [DebugInfo][InstrRef] Short-circuit unnecessary preferred location map construction

Eugene Zhulenev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 03:35:34 PST 2022


ezhulenev updated this revision to Diff 399619.
ezhulenev added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117162

Files:
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp


Index: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
===================================================================
--- llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -283,6 +283,11 @@
       LocIdx Idx = Location.Idx;
       ValueIDNum &VNum = MLocs[Idx.asU64()];
       VarLocs.push_back(VNum);
+
+      // Short-circuit unnecessary preferred location update.
+      if (VLocs.empty())
+        continue;
+
       auto it = ValueToLoc.find(VNum);
       // In order of preference, pick:
       //  * Callee saved registers,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117162.399619.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/4c703567/attachment.bin>


More information about the llvm-commits mailing list