Skip to content

Commit b0ee386

Browse files
fhahncompnerd
authored andcommitted
[ScheduleDAGRRList] Pacify overload mismatch in std::min.
On systems where size() doesn't return unsigned long, this leads to an overloading mismatch. Convert the constant to whatever type is used for Q.size() on the system. (cherry picked from commit 6c9da99)
1 parent 286aaa0 commit b0ee386

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,8 @@ static SUnit *popFromQueueImpl(std::vector<SUnit *> &Q, SF &Picker) {
18411841
unsigned BestIdx = 0;
18421842
// Only compute the cost for the first 1000 items in the queue, to avoid
18431843
// excessive compile-times for very large queues.
1844-
for (unsigned I = 1, E = std::min(Q.size(), 1000ul); I != E; I++)
1844+
for (unsigned I = 1, E = std::min(Q.size(), (decltype(Q.size()))1000); I != E;
1845+
I++)
18451846
if (Picker(Q[BestIdx], Q[I]))
18461847
BestIdx = I;
18471848
SUnit *V = Q[BestIdx];

0 commit comments

Comments
 (0)