Be explicit with abs(). Visual Studio workaround.
authorAndrew Trick <atrick@apple.com>
Sat, 5 Mar 2011 10:29:25 +0000 (10:29 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 5 Mar 2011 10:29:25 +0000 (10:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127075 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index 8821b85a852b82466ac3d7555507fff9f9356377..1575e7b345e6e527120d58007d7004d4a8475005 100644 (file)
@@ -2257,10 +2257,12 @@ bool ilp_ls_rr_sort::operator()(SUnit *left, SUnit *right) const {
     return left->getHeight() > right->getHeight();
   }
 
-  if (!DisableSchedCriticalPath
-      && abs((long)left->getDepth() - right->getDepth()) > MaxReorderWindow) {
-    DEBUG(++FactorCount[FactDepth]);
-    return left->getDepth() < right->getDepth();
+  if (!DisableSchedCriticalPath) {
+    int spread = (int)left->getDepth() - (int)right->getDepth();
+    if (std::abs(spread) > MaxReorderWindow) {
+      DEBUG(++FactorCount[FactDepth]);
+      return left->getDepth() < right->getDepth();
+    }
   }
 
   if (!DisableSchedHeight && left->getHeight() != right->getHeight()) {