[ScheduleDAGRRList] Pacify overload mismatch in std::min.
authorFlorian Hahn <flo@fhahn.com>
Thu, 23 Jul 2020 10:54:38 +0000 (11:54 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 23 Jul 2020 10:56:50 +0000 (11:56 +0100)
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.

llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index ad6a6cd..7a5e8ac 100644 (file)
@@ -1841,7 +1841,8 @@ static SUnit *popFromQueueImpl(std::vector<SUnit *> &Q, SF &Picker) {
   unsigned BestIdx = 0;
   // Only compute the cost for the first 1000 items in the queue, to avoid
   // excessive compile-times for very large queues.
-  for (unsigned I = 1, E = std::min(Q.size(), 1000ul); I != E; I++)
+  for (unsigned I = 1, E = std::min(Q.size(), (decltype(Q.size()))1000); I != E;
+       I++)
     if (Picker(Q[BestIdx], Q[I]))
       BestIdx = I;
   SUnit *V = Q[BestIdx];