LLVM 20.0.0git
|
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign information. More...
#include "llvm/IR/CmpPredicate.h"
Public Member Functions | |
CmpPredicate () | |
Default constructor. | |
CmpPredicate (CmpInst::Predicate Pred, bool HasSameSign=false) | |
Constructed implictly with a either Predicate and samesign information, or just a Predicate, dropping samesign information. | |
operator CmpInst::Predicate () const | |
Implictly converts to the underlying Predicate, dropping samesign information. | |
bool | hasSameSign () const |
Query samesign information, for optimizations. | |
bool | operator== (CmpInst::Predicate P) const |
An operator== on the underlying Predicate. | |
bool | operator!= (CmpInst::Predicate P) const |
bool | operator== (CmpPredicate) const =delete |
There is no operator== defined on CmpPredicate. | |
bool | operator!= (CmpPredicate) const =delete |
Static Public Member Functions | |
static std::optional< CmpPredicate > | getMatching (CmpPredicate A, CmpPredicate B) |
Compares two CmpPredicates taking samesign into account and returns the canonicalized CmpPredicate if they match. | |
static CmpPredicate | get (const CmpInst *Cmp) |
Do a ICmpInst::getCmpPredicate() or CmpInst::getPredicate(), as appropriate. | |
static CmpPredicate | getSwapped (CmpPredicate P) |
Get the swapped predicate of a CmpPredicate. | |
static CmpPredicate | getSwapped (const CmpInst *Cmp) |
Get the swapped predicate of a CmpInst. | |
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign information.
Some functions in ICmpInst construct and return this type in place of a Predicate.
Definition at line 22 of file CmpPredicate.h.
|
inline |
|
inline |
Constructed implictly with a either Predicate and samesign information, or just a Predicate, dropping samesign information.
Definition at line 32 of file CmpPredicate.h.
References assert(), and llvm::CmpInst::isIntPredicate().
|
static |
Do a ICmpInst::getCmpPredicate() or CmpInst::getPredicate(), as appropriate.
Definition at line 3935 of file Instructions.cpp.
Referenced by getSwapped(), llvm::PatternMatch::CmpClass_match< LHS_t, RHS_t, Class, Commutable >::match(), and llvm::PatternMatch::SpecificCmpClass_match< LHS_t, RHS_t, Class, Commutable >::match().
|
static |
Compares two CmpPredicates taking samesign into account and returns the canonicalized CmpPredicate if they match.
An alternative to operator==.
For example, samesign ult + samesign ult -> samesign ult samesign ult + ult -> ult samesign ult + slt -> slt ult + ult -> ult ult + slt -> std::nullopt
Definition at line 3922 of file Instructions.cpp.
References A, B, CmpPredicate(), and llvm::ICmpInst::getFlippedSignednessPredicate().
Referenced by isImpliedCondICmps(), and llvm::PatternMatch::SpecificCmpClass_match< LHS_t, RHS_t, Class, Commutable >::match().
|
static |
Get the swapped predicate of a CmpPredicate.
Definition at line 3941 of file Instructions.cpp.
References llvm::CmpInst::getSwappedPredicate(), and P.
Referenced by getSwapped(), llvm::PatternMatch::CmpClass_match< LHS_t, RHS_t, Class, Commutable >::match(), and llvm::PatternMatch::SpecificCmpClass_match< LHS_t, RHS_t, Class, Commutable >::match().
|
static |
Get the swapped predicate of a CmpInst.
Definition at line 3945 of file Instructions.cpp.
References get(), and getSwapped().
|
inline |
Query samesign information, for optimizations.
Definition at line 42 of file CmpPredicate.h.
Referenced by llvm::ICmpInst::getInverseCmpPredicate(), and llvm::ICmpInst::getSwappedCmpPredicate().
|
inline |
Implictly converts to the underlying Predicate, dropping samesign information.
Definition at line 39 of file CmpPredicate.h.
|
inline |
Definition at line 58 of file CmpPredicate.h.
References P.
|
delete |
|
inline |
An operator== on the underlying Predicate.
Definition at line 57 of file CmpPredicate.h.
References P.
|
delete |
There is no operator== defined on CmpPredicate.
Use getMatching instead to get the canonicalized matching CmpPredicate.