From 7d537ae74704fdbf56e56e8b12c68f99dd2d0cf3 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 20 Feb 2016 10:40:42 +0000 Subject: [PATCH] [SimplifyCFG] Use pointer identity to simplify predicate. No functional change intended. llvm-svn: 261427 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) { -- 2.7.4