LLVM 17.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::ConstraintSystem Class Reference

#include "llvm/Analysis/ConstraintSystem.h"

Public Member Functions

 ConstraintSystem ()
 
 ConstraintSystem (ArrayRef< Value * > FunctionArgs)
 
 ConstraintSystem (const DenseMap< Value *, unsigned > &Value2Index)
 
bool addVariableRow (ArrayRef< int64_t > R)
 
DenseMap< Value *, unsigned > & getValue2Index ()
 
const DenseMap< Value *, unsigned > & getValue2Index () const
 
bool addVariableRowFill (ArrayRef< int64_t > R)
 
bool mayHaveSolution ()
 Returns true if there may be a solution for the constraints in the system.
 
bool isConditionImplied (SmallVector< int64_t, 8 > R) const
 
SmallVector< int64_t > getLastConstraint () const
 
void popLastConstraint ()
 
void popLastNVariables (unsigned N)
 
unsigned size () const
 Returns the number of rows in the constraint system.
 
void dump () const
 Print the constraints in the system.
 

Static Public Member Functions

static SmallVector< int64_t, 8 > negate (SmallVector< int64_t, 8 > R)
 

Detailed Description

Definition at line 23 of file ConstraintSystem.h.

Constructor & Destructor Documentation

◆ ConstraintSystem() [1/3]

llvm::ConstraintSystem::ConstraintSystem ( )
inline

Definition at line 70 of file ConstraintSystem.h.

◆ ConstraintSystem() [2/3]

llvm::ConstraintSystem::ConstraintSystem ( ArrayRef< Value * >  FunctionArgs)
inline

◆ ConstraintSystem() [3/3]

llvm::ConstraintSystem::ConstraintSystem ( const DenseMap< Value *, unsigned > &  Value2Index)
inline

Definition at line 77 of file ConstraintSystem.h.

Member Function Documentation

◆ addVariableRow()

bool llvm::ConstraintSystem::addVariableRow ( ArrayRef< int64_t >  R)
inline

◆ addVariableRowFill()

bool llvm::ConstraintSystem::addVariableRowFill ( ArrayRef< int64_t >  R)
inline

Definition at line 108 of file ConstraintSystem.h.

References addVariableRow(), llvm::all_of(), and llvm::CallingConv::C.

Referenced by dumpConstraint().

◆ dump()

void ConstraintSystem::dump ( ) const

Print the constraints in the system.

Definition at line 165 of file ConstraintSystem.cpp.

References llvm::dbgs(), I, LLVM_DEBUG, Names, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by dumpConstraint(), and mayHaveSolution().

◆ getLastConstraint()

SmallVector< int64_t > llvm::ConstraintSystem::getLastConstraint ( ) const
inline

◆ getValue2Index() [1/2]

DenseMap< Value *, unsigned > & llvm::ConstraintSystem::getValue2Index ( )
inline

Definition at line 103 of file ConstraintSystem.h.

◆ getValue2Index() [2/2]

const DenseMap< Value *, unsigned > & llvm::ConstraintSystem::getValue2Index ( ) const
inline

Definition at line 104 of file ConstraintSystem.h.

◆ isConditionImplied()

bool ConstraintSystem::isConditionImplied ( SmallVector< int64_t, 8 >  R) const

Definition at line 200 of file ConstraintSystem.cpp.

References llvm::all_of(), llvm::CallingConv::C, and negate().

◆ mayHaveSolution()

bool ConstraintSystem::mayHaveSolution ( )

Returns true if there may be a solution for the constraints in the system.

Definition at line 192 of file ConstraintSystem.cpp.

References llvm::dbgs(), dump(), and LLVM_DEBUG.

◆ negate()

static SmallVector< int64_t, 8 > llvm::ConstraintSystem::negate ( SmallVector< int64_t, 8 >  R)
inlinestatic

Definition at line 121 of file ConstraintSystem.h.

References llvm::CallingConv::C, and llvm::MulOverflow().

Referenced by checkAndReplaceCondition(), and isConditionImplied().

◆ popLastConstraint()

void llvm::ConstraintSystem::popLastConstraint ( )
inline

◆ popLastNVariables()

void llvm::ConstraintSystem::popLastNVariables ( unsigned  N)
inline

Definition at line 142 of file ConstraintSystem.h.

References assert(), and N.

◆ size()

unsigned llvm::ConstraintSystem::size ( ) const
inline

Returns the number of rows in the constraint system.

Definition at line 148 of file ConstraintSystem.h.

References llvm::SmallVectorBase< Size_T >::size().


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