Skip to content

Commit 6dd8bf2

Browse files
committed
Use std::max for freq calc.
1 parent be6bf74 commit 6dd8bf2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,9 +2229,7 @@ uint64_t PreRARematStage::ScoredRemat::getFreqDiff(const FreqInfo &Freq) const {
22292229
// to values that will yield the worst possible score given known frequencies
22302230
// in order to penalize rematerializations from or into regions whose
22312231
// frequency is unknown.
2232-
uint64_t DefOrOne = Freq.Regions[Remat->DefRegion];
2233-
if (!DefOrOne)
2234-
DefOrOne = 1;
2232+
uint64_t DefOrOne = std::max(Freq.Regions[Remat->DefRegion], (uint64_t)1);
22352233
uint64_t UseOrMax = Freq.Regions[Remat->UseRegion];
22362234
if (!UseOrMax)
22372235
UseOrMax = Freq.MaxFreq;

0 commit comments

Comments
 (0)