diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index ad6a6cdd82507c..7a5e8ac6075e65 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1841,7 +1841,8 @@ static SUnit *popFromQueueImpl(std::vector &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];