[llvm] r261427 - [SimplifyCFG] Use pointer identity to simplify predicate.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 20 02:40:43 PST 2016
Author: d0k
Date: Sat Feb 20 04:40:42 2016
New Revision: 261427
URL: http://llvm.org/viewvc/llvm-project?rev=261427&view=rev
Log:
[SimplifyCFG] Use pointer identity to simplify predicate.
No functional change intended.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=261427&r1=261426&r2=261427&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Sat Feb 20 04:40:42 2016
@@ -811,11 +811,9 @@ static int ConstantIntSortPredicate(Cons
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) {
More information about the llvm-commits
mailing list