LLVM 22.0.0git
|
#include "llvm/Analysis/ScalarEvolutionDivision.h"
Static Public Member Functions | |
static void | divide (ScalarEvolution &SE, const SCEV *Numerator, const SCEV *Denominator, const SCEV **Quotient, const SCEV **Remainder) |
Computes the Quotient and Remainder of the division of Numerator by Denominator. | |
Definition at line 26 of file ScalarEvolutionDivision.h.
|
static |
Computes the Quotient and Remainder of the division of Numerator by Denominator.
We are not actually performing the division here. Instead, we are trying to find SCEV expressions Quotient and Remainder that satisfy:
Numerator = Denominator * Quotient + Remainder
There may be multiple valid answers for Quotient and Remainder. This function finds one of them. Especially, there is always a trivial solution: (Quotient, Remainder) = (0, Numerator).
Note the following:
Definition at line 59 of file ScalarEvolutionDivision.cpp.
References assert(), D, divide(), llvm::SCEV::isOne(), and llvm::SCEV::isZero().
Referenced by llvm::computeAccessFunctions(), divide(), llvm::findArrayDimensions(), findArrayDimensionsRec(), visitAddExpr(), visitAddRecExpr(), and visitMulExpr().
void SCEVDivision::visitAddExpr | ( | const SCEVAddExpr * | Numerator | ) |
Definition at line 154 of file ScalarEvolutionDivision.cpp.
References divide(), llvm::ScalarEvolution::getAddExpr(), llvm::SCEV::getType(), llvm::SCEVNAryExpr::operands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
void SCEVDivision::visitAddRecExpr | ( | const SCEVAddRecExpr * | Numerator | ) |
Definition at line 137 of file ScalarEvolutionDivision.cpp.
References divide(), llvm::ScalarEvolution::getAddRecExpr(), llvm::SCEVAddRecExpr::getLoop(), llvm::SCEVNAryExpr::getNoWrapFlags(), llvm::SCEVAddRecExpr::getStart(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::SCEV::getType(), and llvm::SCEVAddRecExpr::isAffine().
void SCEVDivision::visitConstant | ( | const SCEVConstant * | Numerator | ) |
Definition at line 112 of file ScalarEvolutionDivision.cpp.
References D, llvm::SCEVConstant::getAPInt(), llvm::APInt::getBitWidth(), llvm::ScalarEvolution::getConstant(), llvm::APInt::sdivrem(), and llvm::APInt::sext().
|
inline |
Definition at line 60 of file ScalarEvolutionDivision.h.
void SCEVDivision::visitMulExpr | ( | const SCEVMulExpr * | Numerator | ) |
Definition at line 180 of file ScalarEvolutionDivision.cpp.
References divide(), llvm::ScalarEvolution::getMinusSCEV(), llvm::ScalarEvolution::getMulExpr(), llvm::SCEV::getType(), llvm::SCEV::isZero(), llvm::SCEVNAryExpr::operands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SCEVParameterRewriter::rewrite(), and llvm::SmallVectorBase< Size_T >::size().
|
inline |
Definition at line 49 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 58 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 52 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 54 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 56 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 50 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 53 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 55 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 57 of file ScalarEvolutionDivision.h.
|
inline |
Definition at line 59 of file ScalarEvolutionDivision.h.
void SCEVDivision::visitVScale | ( | const SCEVVScale * | Numerator | ) |
Definition at line 133 of file ScalarEvolutionDivision.cpp.
|
inline |
Definition at line 51 of file ScalarEvolutionDivision.h.