Lines Matching refs:LUIdx

163   void countRegister(const SCEV *Reg, size_t LUIdx);
164 void dropRegister(const SCEV *Reg, size_t LUIdx);
165 void swapAndDropUse(size_t LUIdx, size_t LastLUIdx);
167 bool isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const;
184 RegUseTracker::countRegister(const SCEV *Reg, size_t LUIdx) { in countRegister() argument
190 RSD.UsedByIndices.resize(std::max(RSD.UsedByIndices.size(), LUIdx + 1)); in countRegister()
191 RSD.UsedByIndices.set(LUIdx); in countRegister()
195 RegUseTracker::dropRegister(const SCEV *Reg, size_t LUIdx) { in dropRegister() argument
199 assert(RSD.UsedByIndices.size() > LUIdx); in dropRegister()
200 RSD.UsedByIndices.reset(LUIdx); in dropRegister()
204 RegUseTracker::swapAndDropUse(size_t LUIdx, size_t LastLUIdx) { in swapAndDropUse() argument
205 assert(LUIdx <= LastLUIdx); in swapAndDropUse()
211 if (LUIdx < UsedByIndices.size()) in swapAndDropUse()
212 UsedByIndices[LUIdx] = in swapAndDropUse()
219 RegUseTracker::isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const { in isRegUsedByUsesOtherThan()
226 if ((size_t)i != LUIdx) return true; in isRegUsedByUsesOtherThan()
297 bool hasRegsUsedByUsesOtherThan(size_t LUIdx,
455 bool Formula::hasRegsUsedByUsesOtherThan(size_t LUIdx, in hasRegsUsedByUsesOtherThan() argument
458 if (RegUses.isRegUsedByUsesOtherThan(ScaledReg, LUIdx)) in hasRegsUsedByUsesOtherThan()
461 if (RegUses.isRegUsedByUsesOtherThan(BaseReg, LUIdx)) in hasRegsUsedByUsesOtherThan()
1104 size_t LUIdx; member
1122 : UserInst(nullptr), OperandValToReplace(nullptr), LUIdx(~size_t(0)), in LSRFixup()
1158 if (LUIdx != ~size_t(0)) in print()
1159 OS << ", LUIdx=" << LUIdx; in print()
1258 void RecomputeRegs(size_t LUIdx, RegUseTracker &Reguses);
1319 void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) { in RecomputeRegs() argument
1331 RegUses.dropRegister(S, LUIdx); in RecomputeRegs()
1712 void DeleteUse(LSRUse &LU, size_t LUIdx);
1716 void InsertInitialFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
1717 void InsertSupplementalFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
1718 void CountRegisters(const Formula &F, size_t LUIdx);
1719 bool InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F);
1723 void GenerateReassociations(LSRUse &LU, unsigned LUIdx, Formula Base,
1726 void GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
1729 void GenerateCombinations(LSRUse &LU, unsigned LUIdx, Formula Base);
1730 void GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx,
1733 void GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
1734 void GenerateConstantOffsetsImpl(LSRUse &LU, unsigned LUIdx,
1738 void GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
1739 void GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx, Formula Base);
1740 void GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base);
1741 void GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base);
2285 size_t LUIdx = P.first->second; in getUse() local
2286 LSRUse &LU = Uses[LUIdx]; in getUse()
2289 return std::make_pair(LUIdx, Offset); in getUse()
2293 size_t LUIdx = Uses.size(); in getUse() local
2294 P.first->second = LUIdx; in getUse()
2296 LSRUse &LU = Uses[LUIdx]; in getUse()
2305 return std::make_pair(LUIdx, Offset); in getUse()
2309 void LSRInstance::DeleteUse(LSRUse &LU, size_t LUIdx) { in DeleteUse() argument
2315 RegUses.swapAndDropUse(LUIdx, Uses.size()); in DeleteUse()
2324 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in FindUseWithSimilarFormula() local
2325 LSRUse &LU = Uses[LUIdx]; in FindUseWithSimilarFormula()
3014 LF.LUIdx = P.first; in CollectFixupsAndInitialFormulae()
3016 LSRUse &LU = Uses[LF.LUIdx]; in CollectFixupsAndInitialFormulae()
3025 InsertInitialFormula(S, LU, LF.LUIdx); in CollectFixupsAndInitialFormulae()
3026 CountRegisters(LU.Formulae.back(), LF.LUIdx); in CollectFixupsAndInitialFormulae()
3036 LSRInstance::InsertInitialFormula(const SCEV *S, LSRUse &LU, size_t LUIdx) { in InsertInitialFormula() argument
3043 bool Inserted = InsertFormula(LU, LUIdx, F); in InsertInitialFormula()
3051 LSRUse &LU, size_t LUIdx) { in InsertSupplementalFormula() argument
3055 bool Inserted = InsertFormula(LU, LUIdx, F); in InsertSupplementalFormula()
3060 void LSRInstance::CountRegisters(const Formula &F, size_t LUIdx) { in CountRegisters() argument
3062 RegUses.countRegister(F.ScaledReg, LUIdx); in CountRegisters()
3064 RegUses.countRegister(BaseReg, LUIdx); in CountRegisters()
3069 bool LSRInstance::InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F) { in InsertFormula() argument
3076 CountRegisters(F, LUIdx); in InsertFormula()
3157 LF.LUIdx = P.first; in CollectLoopInvariantFixupsAndFormulae()
3159 LSRUse &LU = Uses[LF.LUIdx]; in CollectLoopInvariantFixupsAndFormulae()
3165 InsertSupplementalFormula(US, LU, LF.LUIdx); in CollectLoopInvariantFixupsAndFormulae()
3235 void LSRInstance::GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx, in GenerateReassociationsImpl() argument
3310 if (InsertFormula(LU, LUIdx, F)) in GenerateReassociationsImpl()
3313 GenerateReassociations(LU, LUIdx, LU.Formulae.back(), Depth + 1); in GenerateReassociationsImpl()
3318 void LSRInstance::GenerateReassociations(LSRUse &LU, unsigned LUIdx, in GenerateReassociations() argument
3326 GenerateReassociationsImpl(LU, LUIdx, Base, Depth, i); in GenerateReassociations()
3329 GenerateReassociationsImpl(LU, LUIdx, Base, Depth, in GenerateReassociations()
3335 void LSRInstance::GenerateCombinations(LSRUse &LU, unsigned LUIdx, in GenerateCombinations() argument
3362 (void)InsertFormula(LU, LUIdx, F); in GenerateCombinations()
3368 void LSRInstance::GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx, in GenerateSymbolicOffsetsImpl() argument
3383 (void)InsertFormula(LU, LUIdx, F); in GenerateSymbolicOffsetsImpl()
3387 void LSRInstance::GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx, in GenerateSymbolicOffsets() argument
3393 GenerateSymbolicOffsetsImpl(LU, LUIdx, Base, i); in GenerateSymbolicOffsets()
3395 GenerateSymbolicOffsetsImpl(LU, LUIdx, Base, /* Idx */ -1, in GenerateSymbolicOffsets()
3401 LSRUse &LU, unsigned LUIdx, const Formula &Base, in GenerateConstantOffsetsImpl() argument
3424 (void)InsertFormula(LU, LUIdx, F); in GenerateConstantOffsetsImpl()
3439 (void)InsertFormula(LU, LUIdx, F); in GenerateConstantOffsetsImpl()
3443 void LSRInstance::GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx, in GenerateConstantOffsets() argument
3453 GenerateConstantOffsetsImpl(LU, LUIdx, Base, Worklist, i); in GenerateConstantOffsets()
3455 GenerateConstantOffsetsImpl(LU, LUIdx, Base, Worklist, /* Idx */ -1, in GenerateConstantOffsets()
3461 void LSRInstance::GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx, in GenerateICmpZeroScales() argument
3540 (void)InsertFormula(LU, LUIdx, F); in GenerateICmpZeroScales()
3547 void LSRInstance::GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base) { in GenerateScales() argument
3600 (void)InsertFormula(LU, LUIdx, F); in GenerateScales()
3607 void LSRInstance::GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base) { in GenerateTruncates() argument
3626 if (!F.hasRegsUsedByUsesOtherThan(LUIdx, RegUses)) in GenerateTruncates()
3629 (void)InsertFormula(LU, LUIdx, F); in GenerateTruncates()
3640 size_t LUIdx; member
3645 : LUIdx(LI), Imm(I), OrigReg(R) {} in WorkItem()
3654 OS << "in formulae referencing " << *OrigReg << " in use " << LUIdx in print()
3725 for (int LUIdx = UsedByIndices.find_first(); LUIdx != -1; in GenerateCrossUseConstantOffsets() local
3726 LUIdx = UsedByIndices.find_next(LUIdx)) in GenerateCrossUseConstantOffsets()
3728 if (UniqueItems.insert(std::make_pair(LUIdx, Imm)).second) in GenerateCrossUseConstantOffsets()
3729 WorkItems.push_back(WorkItem(LUIdx, Imm, OrigReg)); in GenerateCrossUseConstantOffsets()
3741 size_t LUIdx = WI.LUIdx; in GenerateCrossUseConstantOffsets() local
3742 LSRUse &LU = Uses[LUIdx]; in GenerateCrossUseConstantOffsets()
3783 (void)InsertFormula(LU, LUIdx, NewF); in GenerateCrossUseConstantOffsets()
3815 (void)InsertFormula(LU, LUIdx, NewF); in GenerateCrossUseConstantOffsets()
3829 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in GenerateAllReuseFormulae() local
3830 LSRUse &LU = Uses[LUIdx]; in GenerateAllReuseFormulae()
3832 GenerateReassociations(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3834 GenerateCombinations(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3836 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in GenerateAllReuseFormulae() local
3837 LSRUse &LU = Uses[LUIdx]; in GenerateAllReuseFormulae()
3839 GenerateSymbolicOffsets(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3841 GenerateConstantOffsets(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3843 GenerateICmpZeroScales(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3845 GenerateScales(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3847 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in GenerateAllReuseFormulae() local
3848 LSRUse &LU = Uses[LUIdx]; in GenerateAllReuseFormulae()
3850 GenerateTruncates(LU, LUIdx, LU.Formulae[i]); in GenerateAllReuseFormulae()
3876 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in FilterOutUndesirableDedicatedRegisters() local
3877 LSRUse &LU = Uses[LUIdx]; in FilterOutUndesirableDedicatedRegisters()
3909 if (RegUses.isRegUsedByUsesOtherThan(Reg, LUIdx)) in FilterOutUndesirableDedicatedRegisters()
3913 RegUses.isRegUsedByUsesOtherThan(F.ScaledReg, LUIdx)) in FilterOutUndesirableDedicatedRegisters()
3948 LU.RecomputeRegs(LUIdx, RegUses); in FilterOutUndesirableDedicatedRegisters()
3993 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in NarrowSearchSpaceByDetectingSupersets() local
3994 LSRUse &LU = Uses[LUIdx]; in NarrowSearchSpaceByDetectingSupersets()
4037 LU.RecomputeRegs(LUIdx, RegUses); in NarrowSearchSpaceByDetectingSupersets()
4057 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in NarrowSearchSpaceByCollapsingUnrolledCode() local
4058 LSRUse &LU = Uses[LUIdx]; in NarrowSearchSpaceByCollapsingUnrolledCode()
4077 if (Fixup.LUIdx == LUIdx) { in NarrowSearchSpaceByCollapsingUnrolledCode()
4078 Fixup.LUIdx = LUThatHas - &Uses.front(); in NarrowSearchSpaceByCollapsingUnrolledCode()
4090 if (Fixup.LUIdx == NumUses-1) in NarrowSearchSpaceByCollapsingUnrolledCode()
4091 Fixup.LUIdx = LUIdx; in NarrowSearchSpaceByCollapsingUnrolledCode()
4113 DeleteUse(LU, LUIdx); in NarrowSearchSpaceByCollapsingUnrolledCode()
4114 --LUIdx; in NarrowSearchSpaceByCollapsingUnrolledCode()
4176 for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) { in NarrowSearchSpaceByPickingWinnerRegs() local
4177 LSRUse &LU = Uses[LUIdx]; in NarrowSearchSpaceByPickingWinnerRegs()
4195 LU.RecomputeRegs(LUIdx, RegUses); in NarrowSearchSpaceByPickingWinnerRegs()
4450 const LSRUse &LU = Uses[LF.LUIdx]; in Expand()
4731 if (Uses[LF.LUIdx].Kind == LSRUse::ICmpZero) in Rewrite()
4765 Rewrite(Fixup, *Solution[Fixup.LUIdx], Rewriter, DeadInsts); in ImplementSolution()