Lines Matching defs:LSRUse
242 /// This represents the set of LSRUse indices which reference
1168 class LSRUse;
1182 const LSRUse &LU, const Formula &F);
1186 const LSRUse &LU, const Formula &F,
1236 const LSRUse &LU,
1265 /// A constant offset to be added to the LSRUse expression. This allows
1266 /// multiple fixups to share the same LSRUse with different offsets, for
1308 class LSRUse {
1334 /// This records whether all of the fixups using this LSRUse are outside of
1346 /// LSRUse. FindUseWithSimilarFormula can't consider uses with different max
1356 /// The set of register candidates used by all formulae in this LSRUse.
1359 LSRUse(KindType K, MemAccessTy AT) : Kind(K), AccessTy(AT) {}
1387 LSRUse::KindType Kind, MemAccessTy AccessTy,
1500 const LSRUse &LU,
1553 if (LU.Kind == LSRUse::Address && Offset.isNonZero() &&
1554 !isAMCompletelyFolded(*TTI, LSRUse::Address, LU.AccessTy, F.BaseGV,
1593 if (LU.Kind == LSRUse::ICmpZero && !F.hasZeroEnd() &&
1600 if (LU.Kind != LSRUse::ICmpZero)
1696 bool LSRUse::HasFormulaWithSameRegs(const Formula &F) const {
1705 float LSRUse::getNotSelectedProbability(const SCEV *Reg) const {
1715 bool LSRUse::InsertFormula(const Formula &F, const Loop &L) {
1749 void LSRUse::DeleteFormula(Formula &F) {
1756 void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) {
1772 void LSRUse::print(raw_ostream &OS) const {
1805 LLVM_DUMP_METHOD void LSRUse::dump() const {
1811 LSRUse::KindType Kind, MemAccessTy AccessTy,
1816 case LSRUse::Address: {
1825 case LSRUse::ICmpZero:
1862 case LSRUse::Basic:
1866 case LSRUse::Special:
1871 llvm_unreachable("Invalid LSRUse Kind!");
1876 LSRUse::KindType Kind, MemAccessTy AccessTy,
1902 LSRUse::KindType Kind, MemAccessTy AccessTy,
1918 Immediate MaxOffset, LSRUse::KindType Kind,
1932 Immediate MaxOffset, LSRUse::KindType Kind,
1947 const LSRUse &LU, const Formula &F) {
1949 if (LU.Kind == LSRUse::Address && TTI.LSRWithInstrQueries()) {
1951 if (!isAMCompletelyFolded(TTI, LSRUse::Address, LU.AccessTy, F.BaseGV,
1964 const LSRUse &LU, const Formula &F,
1976 case LSRUse::Address: {
1997 case LSRUse::ICmpZero:
1998 case LSRUse::Basic:
1999 case LSRUse::Special:
2005 llvm_unreachable("Invalid LSRUse Kind!");
2009 LSRUse::KindType Kind, MemAccessTy AccessTy,
2018 int64_t Scale = Kind == LSRUse::ICmpZero ? -1 : 1;
2032 if (HasBaseReg && BaseOffset.isNonZero() && Kind != LSRUse::ICmpZero &&
2042 Immediate MaxOffset, LSRUse::KindType Kind,
2065 int64_t Scale = Kind == LSRUse::ICmpZero ? -1 : 1;
2172 mutable SmallVector<LSRUse, 16> Uses;
2213 using UseMapTy = DenseMap<LSRUse::SCEVUseKindPair, size_t>;
2216 bool reconcileNewOffset(LSRUse &LU, Immediate NewOffset, bool HasBaseReg,
2217 LSRUse::KindType Kind, MemAccessTy AccessTy);
2219 std::pair<size_t, Immediate> getUse(const SCEV *&Expr, LSRUse::KindType Kind,
2222 void DeleteUse(LSRUse &LU, size_t LUIdx);
2224 LSRUse *FindUseWithSimilarFormula(const Formula &F, const LSRUse &OrigLU);
2226 void InsertInitialFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
2227 void InsertSupplementalFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
2229 bool InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F);
2233 void GenerateReassociations(LSRUse &LU, unsigned LUIdx, Formula Base,
2236 void GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
2239 void GenerateCombinations(LSRUse &LU, unsigned LUIdx, Formula Base);
2240 void GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx,
2243 void GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
2244 void GenerateConstantOffsetsImpl(LSRUse &LU, unsigned LUIdx,
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);
2280 const LSRUse &LU) const;
2282 Value *Expand(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2285 void RewriteForPHI(PHINode *PN, const LSRUse &LU, const LSRFixup &LF,
2288 void Rewrite(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2756 bool LSRInstance::reconcileNewOffset(LSRUse &LU, Immediate NewOffset,
2757 bool HasBaseReg, LSRUse::KindType Kind,
2772 if (Kind == LSRUse::Address) {
2806 /// Return an LSRUse index and an offset value for a fixup which needs the given
2810 LSRUse::KindType Kind,
2823 UseMap.insert(std::make_pair(LSRUse::SCEVUseKindPair(Expr, Kind), 0));
2827 LSRUse &LU = Uses[LUIdx];
2836 Uses.push_back(LSRUse(Kind, AccessTy));
2837 LSRUse &LU = Uses[LUIdx];
2845 void LSRInstance::DeleteUse(LSRUse &LU, size_t LUIdx) {
2856 LSRUse *
2858 const LSRUse &OrigLU) {
2860 for (LSRUse &LU : Uses) {
2867 LU.Kind != LSRUse::ICmpZero &&
2884 // can skip the rest of the formulae and proceed to the next LSRUse.
3383 if (!isAlwaysFoldable(TTI, LSRUse::Address, AccessTy, /*BaseGV=*/nullptr,
3541 LSRUse::KindType Kind = LSRUse::Basic;
3544 Kind = LSRUse::Address;
3585 Kind = LSRUse::ICmpZero;
3601 Kind = LSRUse::ICmpZero;
3615 // Get or create an LSRUse.
3619 LSRUse &LU = Uses[LUIdx];
3642 // If this is the first use of this LSRUse, give it a formula.
3654 void LSRInstance::InsertInitialFormula(const SCEV *S, LSRUse &LU,
3670 LSRUse &LU, size_t LUIdx) {
3688 bool LSRInstance::InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F) {
3809 getUse(S, LSRUse::Basic, MemAccessTy());
3812 LSRUse &LU = Uses[LUIdx];
3894 LSRUse &LU, const SCEV *S, const Loop *L,
3896 if (LU.Kind != LSRUse::Address ||
3916 void LSRInstance::GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
4015 void LSRInstance::GenerateReassociations(LSRUse &LU, unsigned LUIdx,
4032 void LSRInstance::GenerateCombinations(LSRUse &LU, unsigned LUIdx,
4096 void LSRInstance::GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx,
4115 void LSRInstance::GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx,
4129 LSRUse &LU, unsigned LUIdx, const Formula &Base,
4169 if (AMK == TTI::AMK_PreIndexed && LU.Kind == LSRUse::Address) {
4209 void LSRInstance::GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx,
4227 void LSRInstance::GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx,
4229 if (LU.Kind != LSRUse::ICmpZero) return;
4328 void LSRInstance::GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base) {
4349 if (LU.Kind == LSRUse::Basic &&
4350 isLegalUse(TTI, LU.MinOffset, LU.MaxOffset, LSRUse::Special,
4353 LU.Kind = LSRUse::Special;
4359 if (LU.Kind == LSRUse::ICmpZero && !Base.HasBaseReg &&
4418 void LSRInstance::GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base) {
4608 LSRUse &LU = Uses[LUIdx];
4718 LSRUse &LU = Uses[LUIdx];
4725 LSRUse &LU = Uses[LUIdx];
4736 LSRUse &LU = Uses[LUIdx];
4766 LSRUse &LU = Uses[LUIdx];
4854 for (const LSRUse &LU : Uses) {
4879 LSRUse &LU = Uses[LUIdx];
4950 LSRUse &LU = Uses[LUIdx];
4955 LSRUse *LUThatHas = FindUseWithSimilarFormula(F, LU);
5018 /// If a LSRUse has multiple formulae with the same ScaledReg and Scale.
5036 // Map the "Scale * ScaledReg" pair to the best formula of current LSRUse.
5047 LSRUse &LU = Uses[LUIdx];
5133 LSRUse &LU = Uses[LUIdx];
5135 if (LU.Kind != LSRUse::Address)
5228 for (const LSRUse &LU : Uses) {
5245 LSRUse &LU = Uses[LUIdx];
5364 if (LUIdx >= 0 && Uses[LUIdx].Kind == LSRUse::Address &&
5373 assert(Best && "Failed to find best LSRUse candidate");
5382 LSRUse &LU = Uses[LUIdx];
5441 const LSRUse &LU = Uses[Workspace.size()];
5461 if (AMK != TTI::AMK_PostIndexed || LU.Kind != LSRUse::Address) {
5625 BasicBlock::iterator LowestIP, const LSRFixup &LF, const LSRUse &LU) const {
5632 if (LU.Kind == LSRUse::ICmpZero)
5684 /// Emit instructions for the leading candidate expression for this LSRUse (this
5686 Value *LSRInstance::Expand(const LSRUse &LU, const LSRFixup &LF,
5735 if (LU.Kind == LSRUse::ICmpZero) {
5754 if (!Ops.empty() && LU.Kind == LSRUse::Address &&
5795 if (LU.Kind == LSRUse::ICmpZero) {
5831 if (LU.Kind == LSRUse::ICmpZero) {
5870 void LSRInstance::RewriteForPHI(PHINode *PN, const LSRUse &LU,
5956 for (LSRUse &LU : Uses)
5991 /// Emit instructions for the leading candidate expression for this LSRUse (this
5994 void LSRInstance::Rewrite(const LSRUse &LU, const LSRFixup &LF,
6018 if (LU.Kind == LSRUse::ICmpZero)
6032 const LSRUse &LU, Instruction *IVIncInsertPos,
6034 if (LU.Kind != LSRUse::Address)
6253 for (const LSRUse &LU : Uses) {
6287 for (const LSRUse &LU : Uses)
6297 for (const LSRUse &LU : Uses) {