[SimplifyCFG] Use pointer identity to simplify predicate.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 20 Feb 2016 10:40:42 +0000 (10:40 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 20 Feb 2016 10:40:42 +0000 (10:40 +0000)
No functional change intended.

llvm-svn: 261427

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

index f689965..f9711e3 100644 (file)
@@ -811,11 +811,9 @@ static int ConstantIntSortPredicate(ConstantInt *const *P1,
                                     ConstantInt *const *P2) {
   const ConstantInt *LHS = *P1;
   const ConstantInt *RHS = *P2;
-  if (LHS->getValue().ult(RHS->getValue()))
-    return 1;
-  if (LHS->getValue() == RHS->getValue())
+  if (LHS == RHS)
     return 0;
-  return -1;
+  return LHS->getValue().ult(RHS->getValue()) ? 1 : -1;
 }
 
 static inline bool HasBranchWeights(const Instruction* I) {