diff options
-rw-r--r-- | llvm/include/llvm/Analysis/CmpInstAnalysis.h | 2 | ||||
-rw-r--r-- | llvm/lib/Analysis/CmpInstAnalysis.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/llvm/include/llvm/Analysis/CmpInstAnalysis.h b/llvm/include/llvm/Analysis/CmpInstAnalysis.h index 3cc69d9fea2..d3f29501110 100644 --- a/llvm/include/llvm/Analysis/CmpInstAnalysis.h +++ b/llvm/include/llvm/Analysis/CmpInstAnalysis.h @@ -58,7 +58,7 @@ namespace llvm { /// Return true if both predicates match sign or if at least one of them is an /// equality comparison (which is signless). - bool PredicatesFoldable(CmpInst::Predicate p1, CmpInst::Predicate p2); + bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2); /// Decompose an icmp into the form ((X & Mask) pred 0) if possible. The /// returned predicate is either == or !=. Returns false if decomposition diff --git a/llvm/lib/Analysis/CmpInstAnalysis.cpp b/llvm/lib/Analysis/CmpInstAnalysis.cpp index 159c1a2d135..42471fe0f14 100644 --- a/llvm/lib/Analysis/CmpInstAnalysis.cpp +++ b/llvm/lib/Analysis/CmpInstAnalysis.cpp @@ -58,10 +58,10 @@ Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, return nullptr; } -bool llvm::PredicatesFoldable(ICmpInst::Predicate p1, ICmpInst::Predicate p2) { - return (CmpInst::isSigned(p1) == CmpInst::isSigned(p2)) || - (CmpInst::isSigned(p1) && ICmpInst::isEquality(p2)) || - (CmpInst::isSigned(p2) && ICmpInst::isEquality(p1)); +bool llvm::predicatesFoldable(ICmpInst::Predicate P1, ICmpInst::Predicate P2) { + return (CmpInst::isSigned(P1) == CmpInst::isSigned(P2)) || + (CmpInst::isSigned(P1) && ICmpInst::isEquality(P2)) || + (CmpInst::isSigned(P2) && ICmpInst::isEquality(P1)); } bool llvm::decomposeBitTestICmp(Value *LHS, Value *RHS, diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 173ae636771..282498e98a4 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -1033,7 +1033,7 @@ Value *InstCombiner::foldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS, ICmpInst::Predicate PredL = LHS->getPredicate(), PredR = RHS->getPredicate(); // (icmp1 A, B) & (icmp2 A, B) --> (icmp3 A, B) - if (PredicatesFoldable(PredL, PredR)) { + if (predicatesFoldable(PredL, PredR)) { if (LHS->getOperand(0) == RHS->getOperand(1) && LHS->getOperand(1) == RHS->getOperand(0)) LHS->swapOperands(); @@ -1131,7 +1131,7 @@ Value *InstCombiner::foldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS, return nullptr; // We can't fold (ugt x, C) & (sgt x, C2). - if (!PredicatesFoldable(PredL, PredR)) + if (!predicatesFoldable(PredL, PredR)) return nullptr; // Ensure that the larger constant is on the RHS. @@ -1976,7 +1976,7 @@ Value *InstCombiner::foldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, } // (icmp1 A, B) | (icmp2 A, B) --> (icmp3 A, B) - if (PredicatesFoldable(PredL, PredR)) { + if (predicatesFoldable(PredL, PredR)) { if (LHS->getOperand(0) == RHS->getOperand(1) && LHS->getOperand(1) == RHS->getOperand(0)) LHS->swapOperands(); @@ -2066,7 +2066,7 @@ Value *InstCombiner::foldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, return nullptr; // We can't fold (ugt x, C) | (sgt x, C2). - if (!PredicatesFoldable(PredL, PredR)) + if (!predicatesFoldable(PredL, PredR)) return nullptr; // Ensure that the larger constant is on the RHS. @@ -2462,7 +2462,7 @@ static Instruction *foldXorToXor(BinaryOperator &I, } Value *InstCombiner::foldXorOfICmps(ICmpInst *LHS, ICmpInst *RHS) { - if (PredicatesFoldable(LHS->getPredicate(), RHS->getPredicate())) { + if (predicatesFoldable(LHS->getPredicate(), RHS->getPredicate())) { if (LHS->getOperand(0) == RHS->getOperand(1) && LHS->getOperand(1) == RHS->getOperand(0)) LHS->swapOperands(); |