llvm::CmpPredicate

An abstraction over a CmpInst predicate with optional samesign information.

Synopsis

Declared in <llvm/IR/CmpPredicate.h>

class CmpPredicate;

Description

Covers floating-point predicates and a pack of an integer predicate with samesign information. Some functions in ICmpInst construct and return this type in place of a Predicate.

Member Functions

NameDescription
CmpPredicate [constructor]Constructors
dropSameSign Drops samesign information. This is used when the samesign information should be dropped explicitly.
getPreferredSignedPredicate Attempt to return a signed CmpInst::Predicate from this CmpPredicate.
hasSameSign Query samesign information, for optimizations.
operator CmpInst::Predicate Implictly converts to the underlying Predicate, dropping samesign information.
operator== Equality operators
operator!= Inequality operators

Static Member Functions

NameDescription
get Do a ICmpInst::getCmpPredicate() or CmpInst::getPredicate(), as appropriate.
getInverse Get the inverse predicate of a CmpPredicate.
getMatching Compares two CmpPredicates taking samesign into account and returns the canonicalized CmpPredicate if they match. An alternative to operator==.
getSwapped getSwapped overloads

Non-Member Functions

NameDescription
getFlippedStrictnessPredicateAndConstantFlip the strictness of an integer compare against a constant RHS.
isImpliedByDomConditionReturn whether a compare is known from dominating conditions at ContextI.
simplifyCmpInstGiven operands for a CmpInst, fold the result or return null.
simplifyFCmpInstGiven operands for an FCmpInst, fold the result or return null.
simplifyICmpInstGiven operands for an ICmpInst, fold the result or return null.
PatternMatch::m_CmpMatches any compare of L and R, binding the predicate to Pred.
PatternMatch::m_FCmpMatches an fcmp of L and R, binding the predicate to Pred.
PatternMatch::m_ICmpMatches an icmp of L and R, binding the predicate to Pred.
PatternMatch::m_ICmpLikeMatches icmp or an equivalent trunc-nuw-to-i1 pattern.
PatternMatch::m_SpecificCmpMatches any compare of L and R with predicate MatchPred.
PatternMatch::m_SpecificFCmpMatches an fcmp of L and R with predicate MatchPred.
PatternMatch::m_SpecificICmpMatches an icmp of L and R with predicate MatchPred.
PatternMatch::m_c_ICmpMatches an ICmp with a predicate over LHS and RHS in either order. Swaps the predicate if operands are commuted.
PatternMatch::m_c_SpecificICmpMatches an icmp of L and R with MatchPred in either order.