LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::SCEVComparePredicate Class Referencefinal

This class represents an assumption that the expression LHS Pred RHS evaluates to true, and this can be checked at run-time. More...

#include "llvm/Analysis/ScalarEvolution.h"

Inheritance diagram for llvm::SCEVComparePredicate:
Inheritance graph
[legend]

Public Member Functions

 SCEVComparePredicate (const FoldingSetNodeIDRef ID, const ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS)
 
bool implies (const SCEVPredicate *N) const override
 Implementation of the SCEVPredicate interface.
 
void print (raw_ostream &OS, unsigned Depth=0) const override
 Prints a textual representation of this predicate with an indentation of Depth.
 
bool isAlwaysTrue () const override
 Returns true if the predicate is always true.
 
ICmpInst::Predicate getPredicate () const
 
const SCEVgetLHS () const
 Returns the left hand side of the predicate.
 
const SCEVgetRHS () const
 Returns the right hand side of the predicate.
 
- Public Member Functions inherited from llvm::SCEVPredicate
 SCEVPredicate (const FoldingSetNodeIDRef ID, SCEVPredicateKind Kind)
 SCEV predicates.
 
SCEVPredicateKind getKind () const
 
virtual unsigned getComplexity () const
 Returns the estimated complexity of this predicate.
 
virtual bool isAlwaysTrue () const =0
 Returns true if the predicate is always true.
 
virtual bool implies (const SCEVPredicate *N) const =0
 Returns true if this predicate implies N.
 
virtual void print (raw_ostream &OS, unsigned Depth=0) const =0
 Prints a textual representation of this predicate with an indentation of Depth.
 
- Public Member Functions inherited from llvm::FoldingSetBase::Node
 Node ()=default
 
void * getNextInBucket () const
 
void SetNextInBucket (void *N)
 

Static Public Member Functions

static bool classof (const SCEVPredicate *P)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 

Additional Inherited Members

- Public Types inherited from llvm::SCEVPredicate
enum  SCEVPredicateKind { P_Union , P_Compare , P_Wrap }
 
- Protected Member Functions inherited from llvm::SCEVPredicate
 ~SCEVPredicate ()=default
 
 SCEVPredicate (const SCEVPredicate &)=default
 
SCEVPredicateoperator= (const SCEVPredicate &)=default
 
- Protected Attributes inherited from llvm::SCEVPredicate
SCEVPredicateKind Kind
 

Detailed Description

This class represents an assumption that the expression LHS Pred RHS evaluates to true, and this can be checked at run-time.

Definition at line 281 of file ScalarEvolution.h.

Constructor & Destructor Documentation

◆ SCEVComparePredicate()

SCEVComparePredicate::SCEVComparePredicate ( const FoldingSetNodeIDRef  ID,
const ICmpInst::Predicate  Pred,
const SCEV LHS,
const SCEV RHS 
)

Definition at line 14620 of file ScalarEvolution.cpp.

References assert(), llvm::Value::getType(), LHS, and RHS.

Member Function Documentation

◆ classof()

static bool llvm::SCEVComparePredicate::classof ( const SCEVPredicate P)
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 306 of file ScalarEvolution.h.

References P, and llvm::SCEVPredicate::P_Compare.

◆ getLHS()

const SCEV * llvm::SCEVComparePredicate::getLHS ( ) const
inline

Returns the left hand side of the predicate.

Definition at line 300 of file ScalarEvolution.h.

References LHS.

Referenced by llvm::SCEVExpander::expandComparePredicate().

◆ getPredicate()

ICmpInst::Predicate llvm::SCEVComparePredicate::getPredicate ( ) const
inline

Definition at line 297 of file ScalarEvolution.h.

Referenced by llvm::SCEVExpander::expandComparePredicate().

◆ getRHS()

const SCEV * llvm::SCEVComparePredicate::getRHS ( ) const
inline

Returns the right hand side of the predicate.

Definition at line 303 of file ScalarEvolution.h.

References RHS.

Referenced by llvm::SCEVExpander::expandComparePredicate().

◆ implies()

bool SCEVComparePredicate::implies ( const SCEVPredicate N) const
overridevirtual

Implementation of the SCEVPredicate interface.

Implements llvm::SCEVPredicate.

Definition at line 14628 of file ScalarEvolution.cpp.

References llvm::CmpInst::ICMP_EQ, LHS, N, and RHS.

◆ isAlwaysTrue()

bool SCEVComparePredicate::isAlwaysTrue ( ) const
overridevirtual

Returns true if the predicate is always true.

This means that no assumptions were made and nothing needs to be checked at run-time.

Implements llvm::SCEVPredicate.

Definition at line 14640 of file ScalarEvolution.cpp.

◆ print()

void SCEVComparePredicate::print ( raw_ostream OS,
unsigned  Depth = 0 
) const
overridevirtual

Prints a textual representation of this predicate with an indentation of Depth.

Implements llvm::SCEVPredicate.

Definition at line 14642 of file ScalarEvolution.cpp.

References llvm::Depth, llvm::CmpInst::ICMP_EQ, llvm::raw_ostream::indent(), LHS, OS, and RHS.


The documentation for this class was generated from the following files: