[Hexagon] Restore minimum profit check accidentally changed in r290024
authorMalcolm Parsons <malcolm.parsons@gmail.com>
Mon, 19 Dec 2016 12:37:26 +0000 (12:37 +0000)
committerMalcolm Parsons <malcolm.parsons@gmail.com>
Mon, 19 Dec 2016 12:37:26 +0000 (12:37 +0000)
llvm-svn: 290100

llvm/lib/Target/Hexagon/HexagonSplitDouble.cpp

index 3ed875a..2c93721 100644 (file)
@@ -397,7 +397,7 @@ bool HexagonSplitDoubleRegs::isProfitable(const USet &Part, LoopRegMap &IRM)
   for (unsigned DR : Part) {
     MachineInstr *DefI = MRI->getVRegDef(DR);
     int32_t P = profit(DefI);
-    if (P == std::numeric_limits<int>::max())
+    if (P == std::numeric_limits<int>::min())
       return false;
     TotalP += P;
     // Reduce the profitability of splitting induction registers.
@@ -430,7 +430,7 @@ bool HexagonSplitDoubleRegs::isProfitable(const USet &Part, LoopRegMap &IRM)
       // Splittable instruction.
       SplitNum++;
       int32_t P = profit(UseI);
-      if (P == std::numeric_limits<int>::max())
+      if (P == std::numeric_limits<int>::min())
         return false;
       TotalP += P;
     }