[llvm] 764e52f - [DebugInfo][InstrRef] Short-circuit unnecessary preferred location map construction

Eugene Zhulenev via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 06:25:00 PST 2022


Author: Eugene Zhulenev
Date: 2022-01-13T06:24:52-08:00
New Revision: 764e52f0d4b68ea9bc01c69d5c8c5a1a5e38d256

URL: https://github.com/llvm/llvm-project/commit/764e52f0d4b68ea9bc01c69d5c8c5a1a5e38d256
DIFF: https://github.com/llvm/llvm-project/commit/764e52f0d4b68ea9bc01c69d5c8c5a1a5e38d256.diff

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

Reviewed By: cota

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index e97dcca201e8e..ad8472c436ab0 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -283,6 +283,11 @@ class TransferTracker {
       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,


        


More information about the llvm-commits mailing list