From 7124801b6f19b757ce2e75b2f716c5397ef7a2a0 Mon Sep 17 00:00:00 2001 From: Wei Mi Date: Fri, 8 Mar 2019 23:29:46 +0000 Subject: [PATCH] [RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid repeated lookup operations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355757 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegisterCoalescer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp index f144c99cdd4..237cf184d8b 100644 --- a/lib/CodeGen/RegisterCoalescer.cpp +++ b/lib/CodeGen/RegisterCoalescer.cpp @@ -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; -- 2.50.1