MLIR  20.0.0git
Classes | Namespaces | Enumerations | Functions
Utils.h File Reference
#include "mlir/Analysis/Presburger/Matrix.h"
#include "llvm/ADT/DynamicAPInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <string>

Go to the source code of this file.

Classes

class  mlir::presburger::MaybeOptimum< T >
 
struct  mlir::presburger::MaybeLocalRepr
 MaybeLocalRepr contains the indices of the constraints that can be expressed as a floordiv of an affine function. More...
 
class  mlir::presburger::DivisionRepr
 Class storing division representation of local variables of a constraint system. More...
 
struct  mlir::presburger::PrintTableMetrics
 Example usage: Print .12, 3.4, 56.7 preAlign = ".", minSpacing = 1, .12 .12 3.4 3.4 56.7 56.7. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::presburger
 

Enumerations

enum class  mlir::presburger::OptimumKind { mlir::presburger::Empty , mlir::presburger::Unbounded , mlir::presburger::Bounded }
 This class represents the result of operations optimizing something subject to some constraints. More...
 
enum class  mlir::presburger::ReprKind { mlir::presburger::Inequality , mlir::presburger::Equality , mlir::presburger::None }
 ReprKind enum is used to set the constraint type in MaybeLocalRepr. More...
 

Functions

SmallVector< DynamicAPInt, 8 > mlir::presburger::getDivUpperBound (ArrayRef< DynamicAPInt > dividend, const DynamicAPInt &divisor, unsigned localVarIdx)
 If q is defined to be equal to expr floordiv d, this equivalent to saying that q is an integer and q is subject to the inequalities 0 <= expr - d*q <= c - 1 (quotient remainder theorem). More...
 
SmallVector< DynamicAPInt, 8 > mlir::presburger::getDivLowerBound (ArrayRef< DynamicAPInt > dividend, const DynamicAPInt &divisor, unsigned localVarIdx)
 
llvm::SmallBitVector mlir::presburger::getSubrangeBitVector (unsigned len, unsigned setOffset, unsigned numSet)
 
SmallVector< DynamicAPInt, 8 > mlir::presburger::getDynamicAPIntVec (ArrayRef< int64_t > range)
 Check if the pos^th variable can be expressed as a floordiv of an affine function of other variables (where the divisor is a positive constant). More...
 
SmallVector< int64_t, 8 > mlir::presburger::getInt64Vec (ArrayRef< DynamicAPInt > range)
 Return the given array as an array of int64_t. More...
 
MaybeLocalRepr mlir::presburger::computeSingleVarRepr (const IntegerRelation &cst, ArrayRef< bool > foundRepr, unsigned pos, MutableArrayRef< DynamicAPInt > dividend, DynamicAPInt &divisor)
 Returns the MaybeLocalRepr struct which contains the indices of the constraints that can be expressed as a floordiv of an affine function. More...
 
MaybeLocalRepr mlir::presburger::computeSingleVarRepr (const IntegerRelation &cst, ArrayRef< bool > foundRepr, unsigned pos, SmallVector< int64_t, 8 > &dividend, unsigned &divisor)
 The following overload using int64_t is required for a callsite in AffineStructures.h. More...
 
void mlir::presburger::mergeLocalVars (IntegerRelation &relA, IntegerRelation &relB, llvm::function_ref< bool(unsigned i, unsigned j)> merge)
 Given two relations, A and B, add additional local vars to the sets such that both have the union of the local vars in each set, without changing the set of points that lie in A and B. More...
 
DynamicAPInt mlir::presburger::gcdRange (ArrayRef< DynamicAPInt > range)
 Compute the gcd of the range. More...
 
DynamicAPInt mlir::presburger::normalizeRange (MutableArrayRef< DynamicAPInt > range)
 Divide the range by its gcd and return the gcd. More...
 
void mlir::presburger::normalizeDiv (MutableArrayRef< DynamicAPInt > num, DynamicAPInt &denom)
 Normalize the given (numerator, denominator) pair by dividing out the common factors between them. More...
 
SmallVector< DynamicAPInt, 8 > mlir::presburger::getNegatedCoeffs (ArrayRef< DynamicAPInt > coeffs)
 Return coeffs with all the elements negated. More...
 
SmallVector< DynamicAPInt, 8 > mlir::presburger::getComplementIneq (ArrayRef< DynamicAPInt > ineq)
 Return the complement of the given inequality. More...
 
Fraction mlir::presburger::dotProduct (ArrayRef< Fraction > a, ArrayRef< Fraction > b)
 Compute the dot product of two vectors. More...
 
std::vector< Fractionmlir::presburger::multiplyPolynomials (ArrayRef< Fraction > a, ArrayRef< Fraction > b)
 Find the product of two polynomials, each given by an array of coefficients. More...
 
bool mlir::presburger::isRangeZero (ArrayRef< Fraction > arr)
 
template<class T >
void mlir::presburger::updatePrintMetrics (T val, PrintTableMetrics &m)
 Iterate over each val in the table and update 'm' where .maxPreIndent and .maxPostIndent are initialized to 0. More...
 
template<class T >
void mlir::presburger::printWithPrintMetrics (raw_ostream &os, T val, unsigned minSpacing, const PrintTableMetrics &m)
 Print val in the table with metrics specified in 'm'. More...