diff options
author | Andrew Trick <atrick@apple.com> | 2011-03-05 10:29:25 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-03-05 10:29:25 +0000 |
commit | afc7d235e91a769f74d87bbe745558ed1b692ff7 (patch) | |
tree | 2414aef3eb92e7a0d99f18be28be12bc80dd63d0 /lib/CodeGen | |
parent | 9869c2f71744821d77fca2d0596cd9f27f84c5d2 (diff) | |
download | llvm-afc7d235e91a769f74d87bbe745558ed1b692ff7.tar.gz llvm-afc7d235e91a769f74d87bbe745558ed1b692ff7.tar.bz2 llvm-afc7d235e91a769f74d87bbe745558ed1b692ff7.tar.xz |
Be explicit with abs(). Visual Studio workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 8821b85a85..1575e7b345 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -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()) { |