|
LLVM 24.0.0git
|
#include "llvm/Analysis/ConstraintSystem.h"
Classes | |
| struct | Entry |
Public Types | |
| using | RowTy = SmallVector<Entry, 8> |
| A single constraint of the form 'c >= v1 * c1 + ... + vn * cn'. | |
Public Member Functions | |
| ConstraintSystem ()=default | |
| ConstraintSystem (ArrayRef< Value * > FunctionArgs) | |
| ConstraintSystem (const DenseMap< Value *, unsigned > &Value2Index) | |
| bool | addRow (ArrayRef< Entry > R, size_t NumVars) |
| DenseMap< Value *, unsigned > & | getValue2Index () |
| const DenseMap< Value *, unsigned > & | getValue2Index () const |
| LLVM_ABI bool | mayHaveSolution () |
| Returns true if there may be a solution for the constraints in the system. | |
| LLVM_ABI std::pair< ConstraintSystem, RowTy > | getSubSystem (ArrayRef< Entry > R) const |
Build and return a sub-system of constraints connected (transitively) to query R, with variables compacted to a dense index range. | |
| LLVM_ABI bool | isConditionImplied (RowTy R) const |
| LLVM_ABI bool | isConditionImpliedInSubSystem (ArrayRef< Entry > R) const |
| const RowTy & | getLastConstraint () const |
| void | popLastConstraint () |
| void | popLastNVariables (unsigned N) |
| unsigned | size () const |
| Returns the number of rows in the constraint system. | |
| LLVM_ABI void | dump () const |
| Print the constraints in the system. | |
Static Public Member Functions | |
| static RowTy | negate (RowTy R) |
| static RowTy | negateOrEqual (RowTy R) |
| Multiplies each coefficient in the given row by -1. | |
| static RowTy | toStrictLessThan (RowTy R) |
| Converts the given row to form a strict less than inequality. | |
Definition at line 23 of file ConstraintSystem.h.
| using llvm::ConstraintSystem::RowTy = SmallVector<Entry, 8> |
A single constraint of the form 'c >= v1 * c1 + ... + vn * cn'.
Definition at line 34 of file ConstraintSystem.h.
|
default |
Referenced by getSubSystem().
Definition at line 84 of file ConstraintSystem.h.
References llvm::ArrayRef< T >::size().
|
inline |
Definition at line 90 of file ConstraintSystem.h.
References size().
Definition at line 93 of file ConstraintSystem.h.
References assert(), E(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by dumpConstraint().
| void ConstraintSystem::dump | ( | ) | const |
Print the constraints in the system.
Definition at line 184 of file ConstraintSystem.cpp.
References llvm::dbgs(), llvm::join(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by dumpConstraint(), and mayHaveSolution().
Definition at line 161 of file ConstraintSystem.h.
References assert().
| std::pair< ConstraintSystem, ConstraintSystem::RowTy > ConstraintSystem::getSubSystem | ( | ArrayRef< Entry > | R | ) | const |
Build and return a sub-system of constraints connected (transitively) to query R, with variables compacted to a dense index range.
Also translate R's entries to the sub-system.
Definition at line 221 of file ConstraintSystem.cpp.
References llvm::any_of(), assert(), Changed, ConstraintSystem(), llvm::SmallVectorImpl< T >::emplace_back(), and llvm::SmallBitVector::set_bits().
Referenced by isConditionImpliedInSubSystem().
Definition at line 110 of file ConstraintSystem.h.
Definition at line 111 of file ConstraintSystem.h.
Definition at line 280 of file ConstraintSystem.cpp.
References negate().
Definition at line 297 of file ConstraintSystem.cpp.
References getSubSystem().
| bool ConstraintSystem::mayHaveSolution | ( | ) |
Returns true if there may be a solution for the constraints in the system.
Definition at line 212 of file ConstraintSystem.cpp.
References llvm::dbgs(), dump(), and LLVM_DEBUG.
Definition at line 118 of file ConstraintSystem.h.
References llvm::AddOverflow(), assert(), and negateOrEqual().
Referenced by isConditionImplied().
Multiplies each coefficient in the given row by -1.
Returns an empty row on overflow. Does not modify the original row.
| R | The row of coefficients to be negated. |
Definition at line 132 of file ConstraintSystem.h.
References E(), and llvm::MulOverflow().
Referenced by negate().
|
inline |
Definition at line 166 of file ConstraintSystem.h.
|
inline |
Definition at line 167 of file ConstraintSystem.h.
|
inline |
Returns the number of rows in the constraint system.
Definition at line 173 of file ConstraintSystem.h.
Referenced by ConstraintSystem().
Converts the given row to form a strict less than inequality.
Returns an empty row on overflow. Does not modify the original row.
| R | The row of coefficients to be converted. |
Definition at line 144 of file ConstraintSystem.h.
References assert(), and llvm::SubOverflow().