Lines Matching defs:Formula
475 struct Formula {
513 Formula() = default;
593 /// Incorporate loop-variant parts of S into this Formula, attempting to keep
595 void Formula::initialMatch(const SCEV *S, Loop *L, ScalarEvolution &SE) {
622 /// \see Formula::BaseRegs.
623 bool Formula::isCanonical(const Loop &L) const {
648 /// \see Formula::BaseRegs.
653 void Formula::canonicalize(const Loop &L) {
690 bool Formula::unscale() {
699 bool Formula::hasZeroEnd() const {
709 size_t Formula::getNumRegs() const {
715 Type *Formula::getType() const {
723 void Formula::deleteBaseReg(const SCEV *&S) {
730 bool Formula::referencesReg(const SCEV *S) const {
736 bool Formula::hasRegsUsedByUsesOtherThan(size_t LUIdx,
748 void Formula::print(raw_ostream &OS) const {
784 LLVM_DUMP_METHOD void Formula::dump() const {
1182 const LSRUse &LU, const Formula &F);
1186 const LSRUse &LU, const Formula &F,
1233 void RateFormula(const Formula &F,
1243 void RateRegister(const Formula &F, const SCEV *Reg,
1245 void RatePrimaryRegister(const Formula &F, const SCEV *Reg,
1354 SmallVector<Formula, 12> Formulae;
1374 bool HasFormulaWithSameRegs(const Formula &F) const;
1376 bool InsertFormula(const Formula &F, const Loop &L);
1377 void DeleteFormula(Formula &F);
1413 void Cost::RateRegister(const Formula &F, const SCEV *Reg,
1483 void Cost::RatePrimaryRegister(const Formula &F, const SCEV *Reg,
1497 void Cost::RateFormula(const Formula &F,
1696 bool LSRUse::HasFormulaWithSameRegs(const Formula &F) const {
1707 for (const Formula &F : Formulae)
1715 bool LSRUse::InsertFormula(const Formula &F, const Loop &L) {
1749 void LSRUse::DeleteFormula(Formula &F) {
1760 for (const Formula &F : Formulae) {
1903 const Formula &F, const Loop &L) {
1933 MemAccessTy AccessTy, const Formula &F) {
1947 const LSRUse &LU, const Formula &F) {
1964 const LSRUse &LU, const Formula &F,
2224 LSRUse *FindUseWithSimilarFormula(const Formula &F, const LSRUse &OrigLU);
2228 void CountRegisters(const Formula &F, size_t LUIdx);
2229 bool InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F);
2233 void GenerateReassociations(LSRUse &LU, unsigned LUIdx, Formula Base,
2237 const Formula &Base, unsigned Depth,
2239 void GenerateCombinations(LSRUse &LU, unsigned LUIdx, Formula Base);
2241 const Formula &Base, size_t Idx,
2243 void GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
2245 const Formula &Base,
2248 void GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
2249 void GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx, Formula Base);
2250 void GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base);
2251 void GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base);
2267 void SolveRecurse(SmallVectorImpl<const Formula *> &Solution,
2269 SmallVectorImpl<const Formula *> &Workspace,
2273 void Solve(SmallVectorImpl<const Formula *> &Solution) const;
2282 Value *Expand(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2286 const Formula &F,
2288 void Rewrite(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2290 void ImplementSolution(const SmallVectorImpl<const Formula *> &Solution);
2857 LSRInstance::FindUseWithSimilarFormula(const Formula &OrigF,
2872 for (const Formula &F : LU.Formulae) {
3629 // Create SCEV as Formula for calculating baseline cost
3631 Formula F;
3660 Formula F;
3671 Formula F;
3679 void LSRInstance::CountRegisters(const Formula &F, size_t LUIdx) {
3688 bool LSRInstance::InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F) {
3691 "Formula is illegal");
3917 const Formula &Base,
3965 Formula F = Base;
4016 Formula Base, unsigned Depth) {
4033 Formula Base) {
4044 Formula NewBase = Base;
4065 Formula F = NewBase;
4097 const Formula &Base, size_t Idx,
4103 Formula F = Base;
4116 Formula Base) {
4129 LSRUse &LU, unsigned LUIdx, const Formula &Base,
4133 Formula F = Base;
4193 Formula F = Base;
4201 // We may generate non canonical Formula if G is a recurrent expr reg
4210 Formula Base) {
4228 Formula Base) {
4280 Formula F = Base;
4328 void LSRInstance::GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base) {
4333 // If this Formula already has a scaled register, we can't add another one.
4374 Formula F = Base;
4384 // non canonical Formula with ScaledReg's loop not being L.
4418 void LSRInstance::GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base) {
4442 Formula F = Base;
4618 Formula F = LU.Formulae[L];
4622 // Formula.
4633 Formula NewF = F;
4665 Formula NewF = F;
4773 Formula &F = LU.Formulae[FIdx];
4813 Formula &Best = LU.Formulae[P.first->second];
4882 Formula &F = LU.Formulae[i];
4891 Formula NewF = F;
4911 Formula NewF = F;
4951 for (const Formula &F : LU.Formulae) {
4977 Formula &F = LUThatHas->Formulae[i];
5033 "Narrowing the search space by choosing the best Formula "
5051 // Return true if Formula FA is better than Formula FB.
5052 auto IsBetterThan = [&](Formula &FA, Formula &FB) {
5053 // First we will try to choose the Formula with fewer new registers.
5054 // For a register used by current Formula, the more the register is
5070 // If the new register numbers are the same, choose the Formula with
5084 Formula &F = LU.Formulae[FIdx];
5091 Formula &Best = LU.Formulae[P.first->second];
5130 "register Formula for PostInc Uses.\n");
5142 for (const Formula &F : LU.Formulae)
5148 Formula &F = LU.Formulae[FIdx];
5256 Formula &F = LU.Formulae[i];
5294 Formula &F = LU.Formulae[0];
5387 Formula &F = LU.Formulae[i];
5425 void LSRInstance::SolveRecurse(SmallVectorImpl<const Formula *> &Solution,
5427 SmallVectorImpl<const Formula *> &Workspace,
5454 for (const Formula &F : LU.Formulae) {
5507 void LSRInstance::Solve(SmallVectorImpl<const Formula *> &Solution) const {
5508 SmallVector<const Formula *, 8> Workspace;
5687 const Formula &F, BasicBlock::iterator IP,
5828 // An ICmpZero Formula represents an ICmp which we're handling as a
5871 const LSRFixup &LF, const Formula &F,
5995 const Formula &F,
6061 const SmallVectorImpl<const Formula *> &Solution) {
6240 SmallVector<const Formula *, 8> Solution;
6254 for (const Formula &F : LU.Formulae)
6301 for (const Formula &F : LU.Formulae) {