[llvm] r355757 - [RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid
Wei Mi via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 8 15:29:46 PST 2019
Author: wmi
Date: Fri Mar 8 15:29:46 2019
New Revision: 355757
URL: http://llvm.org/viewvc/llvm-project?rev=355757&view=rev
Log:
[RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid
repeated lookup operations
Modified:
llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=355757&r1=355756&r2=355757&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Fri Mar 8 15:29:46 2019
@@ -3277,8 +3277,9 @@ void RegisterCoalescer::mergeSubRangeInt
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;
More information about the llvm-commits
mailing list