]> granicus.if.org Git - llvm/commitdiff
[RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid
authorWei Mi <wmi@google.com>
Fri, 8 Mar 2019 23:29:46 +0000 (23:29 +0000)
committerWei Mi <wmi@google.com>
Fri, 8 Mar 2019 23:29:46 +0000 (23:29 +0000)
repeated lookup operations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355757 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterCoalescer.cpp

index f144c99cdd45f0d63b65c49016ea4397b435dc37..237cf184d8bc7ebb56b8a5b95d87f114529f7b72 100644 (file)
@@ -3277,8 +3277,9 @@ void RegisterCoalescer::mergeSubRangeInto(LiveInterval &LI,
 bool RegisterCoalescer::isHighCostLiveInterval(LiveInterval &LI) {
   if (LI.valnos.size() < LargeIntervalSizeThreshold)
     return false;
-  if (LargeLIVisitCounter[LI.reg] < LargeIntervalFreqThreshold) {
-    LargeLIVisitCounter[LI.reg]++;
+  auto &counter = LargeLIVisitCounter[LI.reg];
+  if (counter < LargeIntervalFreqThreshold) {
+    counter++;
     return false;
   }
   return true;