Skip to content

Commit 1a633a4

Browse files
stefan-iligcbot
authored andcommitted
Reduce memory usage of FrequencyInfo
Don't collect data for static live ranges if dumps are not enabled.
1 parent 0849c9c commit 1a633a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

visa/FrequencyInfo.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ class FrequencyInfo {
143143
refFreqs[lr] = llvm::ScaledNumber<uint64_t>::getZero();
144144
refFreqs[lr] += refFreq;
145145

146-
if (staticRefCnts.find(lr) == staticRefCnts.end())
147-
staticRefCnts[lr] = 0;
148-
staticRefCnts[lr] += 1;
146+
if (willDumpOnSpilThreshold() || willDumpSpillCostAnalysis()) {
147+
if (staticRefCnts.find(lr) == staticRefCnts.end())
148+
staticRefCnts[lr] = 0;
149+
staticRefCnts[lr] += 1;
150+
}
151+
149152
return;
150153
};
151154

0 commit comments

Comments
 (0)