[RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid

repeated lookup operations

llvm-svn: 355757
This commit is contained in:
Wei Mi 2019-03-08 23:29:46 +00:00
parent 5cfb65a6fb
commit 36966ef797

View 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;