Skip to content

Commit b0f4cd6

Browse files
committed
Use std::max for freq calc.
1 parent b805a71 commit b0f4cd6

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
@@ -2252,9 +2252,7 @@ uint64_t PreRARematStage::ScoredRemat::getFreqDiff(const FreqInfo &Freq) const {
22522252
// to values that will yield the worst possible score given known frequencies
22532253
// in order to penalize rematerializations from or into regions whose
22542254
// frequency is unknown.
2255-
uint64_t DefOrOne = Freq.Regions[Remat->DefRegion];
2256-
if (!DefOrOne)
2257-
DefOrOne = 1;
2255+
uint64_t DefOrOne = std::max(Freq.Regions[Remat->DefRegion], (uint64_t)1);
22582256
uint64_t UseOrMax = Freq.Regions[Remat->UseRegion];
22592257
if (!UseOrMax)
22602258
UseOrMax = Freq.MaxFreq;

0 commit comments

Comments
 (0)