From: Wei Mi Date: Fri, 8 Mar 2019 23:29:46 +0000 (+0000) Subject: [RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7124801b6f19b757ce2e75b2f716c5397ef7a2a0;p=llvm [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 --- 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;