[llvm] 6c9da99 - [ScheduleDAGRRList] Pacify overload mismatch in std::min.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 03:57:15 PDT 2020


Author: Florian Hahn
Date: 2020-07-23T11:56:50+01:00
New Revision: 6c9da995fc44058cfaddae0f578106dcff401a68

URL: https://github.com/llvm/llvm-project/commit/6c9da995fc44058cfaddae0f578106dcff401a68
DIFF: https://github.com/llvm/llvm-project/commit/6c9da995fc44058cfaddae0f578106dcff401a68.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index ad6a6cdd8250..7a5e8ac6075e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -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];


        


More information about the llvm-commits mailing list