From: Benjamin Kramer Date: Sat, 20 Feb 2016 10:40:42 +0000 (+0000) Subject: [SimplifyCFG] Use pointer identity to simplify predicate. X-Git-Tag: llvmorg-3.9.0-rc1~13659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d537ae74704fdbf56e56e8b12c68f99dd2d0cf3;p=platform%2Fupstream%2Fllvm.git [SimplifyCFG] Use pointer identity to simplify predicate. No functional change intended. llvm-svn: 261427 --- diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index f689965..f9711e3 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -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) {