Lines Matching defs:LSRUse

250   /// This represents the set of LSRUse indices which reference
1173 class LSRUse;
1187 const LSRUse &LU, const Formula &F);
1191 const LSRUse &LU, const Formula &F,
1241 const LSRUse &LU,
1270 /// A constant offset to be added to the LSRUse expression. This allows
1271 /// multiple fixups to share the same LSRUse with different offsets, for
1313 class LSRUse {
1339 /// This records whether all of the fixups using this LSRUse are outside of
1351 /// LSRUse. FindUseWithSimilarFormula can't consider uses with different max
1361 /// The set of register candidates used by all formulae in this LSRUse.
1364 LSRUse(KindType K, MemAccessTy AT) : Kind(K), AccessTy(AT) {}
1392 LSRUse::KindType Kind, MemAccessTy AccessTy,
1505 const LSRUse &LU,
1558 if (LU.Kind == LSRUse::Address && Offset.isNonZero() &&
1559 !isAMCompletelyFolded(*TTI, LSRUse::Address, LU.AccessTy, F.BaseGV,
1598 if (LU.Kind == LSRUse::ICmpZero && !F.hasZeroEnd() &&
1605 if (LU.Kind != LSRUse::ICmpZero)
1701 bool LSRUse::HasFormulaWithSameRegs(const Formula &F) const {
1710 float LSRUse::getNotSelectedProbability(const SCEV *Reg) const {
1720 bool LSRUse::InsertFormula(const Formula &F, const Loop &L) {
1754 void LSRUse::DeleteFormula(Formula &F) {
1761 void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) {
1777 void LSRUse::print(raw_ostream &OS) const {
1810 LLVM_DUMP_METHOD void LSRUse::dump() const {
1816 LSRUse::KindType Kind, MemAccessTy AccessTy,
1821 case LSRUse::Address: {
1830 case LSRUse::ICmpZero:
1867 case LSRUse::Basic:
1871 case LSRUse::Special:
1876 llvm_unreachable("Invalid LSRUse Kind!");
1881 LSRUse::KindType Kind, MemAccessTy AccessTy,
1907 LSRUse::KindType Kind, MemAccessTy AccessTy,
1923 Immediate MaxOffset, LSRUse::KindType Kind,
1937 Immediate MaxOffset, LSRUse::KindType Kind,
1952 const LSRUse &LU, const Formula &F) {
1954 if (LU.Kind == LSRUse::Address && TTI.LSRWithInstrQueries()) {
1956 if (!isAMCompletelyFolded(TTI, LSRUse::Address, LU.AccessTy, F.BaseGV,
1969 const LSRUse &LU, const Formula &F,
1981 case LSRUse::Address: {
2002 case LSRUse::ICmpZero:
2003 case LSRUse::Basic:
2004 case LSRUse::Special:
2010 llvm_unreachable("Invalid LSRUse Kind!");
2014 LSRUse::KindType Kind, MemAccessTy AccessTy,
2023 int64_t Scale = Kind == LSRUse::ICmpZero ? -1 : 1;
2037 if (HasBaseReg && BaseOffset.isNonZero() && Kind != LSRUse::ICmpZero &&
2047 Immediate MaxOffset, LSRUse::KindType Kind,
2070 int64_t Scale = Kind == LSRUse::ICmpZero ? -1 : 1;
2177 mutable SmallVector<LSRUse, 16> Uses;
2212 using UseMapTy = DenseMap<LSRUse::SCEVUseKindPair, size_t>;
2215 bool reconcileNewOffset(LSRUse &LU, Immediate NewOffset, bool HasBaseReg,
2216 LSRUse::KindType Kind, MemAccessTy AccessTy);
2218 std::pair<size_t, Immediate> getUse(const SCEV *&Expr, LSRUse::KindType Kind,
2221 void DeleteUse(LSRUse &LU, size_t LUIdx);
2223 LSRUse *FindUseWithSimilarFormula(const Formula &F, const LSRUse &OrigLU);
2225 void InsertInitialFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
2226 void InsertSupplementalFormula(const SCEV *S, LSRUse &LU, size_t LUIdx);
2228 bool InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F);
2232 void GenerateReassociations(LSRUse &LU, unsigned LUIdx, Formula Base,
2235 void GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
2238 void GenerateCombinations(LSRUse &LU, unsigned LUIdx, Formula Base);
2239 void GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx,
2242 void GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
2243 void GenerateConstantOffsetsImpl(LSRUse &LU, unsigned LUIdx,
2247 void GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx, Formula Base);
2248 void GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx, Formula Base);
2249 void GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base);
2250 void GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base);
2279 const LSRUse &LU) const;
2281 Value *Expand(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2284 void RewriteForPHI(PHINode *PN, const LSRUse &LU, const LSRFixup &LF,
2287 void Rewrite(const LSRUse &LU, const LSRFixup &LF, const Formula &F,
2755 bool LSRInstance::reconcileNewOffset(LSRUse &LU, Immediate NewOffset,
2756 bool HasBaseReg, LSRUse::KindType Kind,
2771 if (Kind == LSRUse::Address) {
2805 /// Return an LSRUse index and an offset value for a fixup which needs the given
2809 LSRUse::KindType Kind,
2822 UseMap.insert(std::make_pair(LSRUse::SCEVUseKindPair(Expr, Kind), 0));
2826 LSRUse &LU = Uses[LUIdx];
2835 Uses.push_back(LSRUse(Kind, AccessTy));
2836 LSRUse &LU = Uses[LUIdx];
2844 void LSRInstance::DeleteUse(LSRUse &LU, size_t LUIdx) {
2855 LSRUse *
2857 const LSRUse &OrigLU) {
2859 for (LSRUse &LU : Uses) {
2866 LU.Kind != LSRUse::ICmpZero &&
2883 // can skip the rest of the formulae and proceed to the next LSRUse.
3382 if (!isAlwaysFoldable(TTI, LSRUse::Address, AccessTy, /*BaseGV=*/nullptr,
3540 LSRUse::KindType Kind = LSRUse::Basic;
3543 Kind = LSRUse::Address;
3584 Kind = LSRUse::ICmpZero;
3600 Kind = LSRUse::ICmpZero;
3614 // Get or create an LSRUse.
3618 LSRUse &LU = Uses[LUIdx];
3641 // If this is the first use of this LSRUse, give it a formula.
3653 void LSRInstance::InsertInitialFormula(const SCEV *S, LSRUse &LU,
3669 LSRUse &LU, size_t LUIdx) {
3687 bool LSRInstance::InsertFormula(LSRUse &LU, unsigned LUIdx, const Formula &F) {
3808 getUse(S, LSRUse::Basic, MemAccessTy());
3811 LSRUse &LU = Uses[LUIdx];
3893 LSRUse &LU, const SCEV *S, const Loop *L,
3895 if (LU.Kind != LSRUse::Address ||
3915 void LSRInstance::GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
4013 void LSRInstance::GenerateReassociations(LSRUse &LU, unsigned LUIdx,
4030 void LSRInstance::GenerateCombinations(LSRUse &LU, unsigned LUIdx,
4094 void LSRInstance::GenerateSymbolicOffsetsImpl(LSRUse &LU, unsigned LUIdx,
4113 void LSRInstance::GenerateSymbolicOffsets(LSRUse &LU, unsigned LUIdx,
4127 LSRUse &LU, unsigned LUIdx, const Formula &Base,
4167 if (AMK == TTI::AMK_PreIndexed && LU.Kind == LSRUse::Address) {
4207 void LSRInstance::GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx,
4225 void LSRInstance::GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx,
4227 if (LU.Kind != LSRUse::ICmpZero) return;
4326 void LSRInstance::GenerateScales(LSRUse &LU, unsigned LUIdx, Formula Base) {
4347 if (LU.Kind == LSRUse::Basic &&
4348 isLegalUse(TTI, LU.MinOffset, LU.MaxOffset, LSRUse::Special,
4351 LU.Kind = LSRUse::Special;
4357 if (LU.Kind == LSRUse::ICmpZero && !Base.HasBaseReg &&
4416 void LSRInstance::GenerateTruncates(LSRUse &LU, unsigned LUIdx, Formula Base) {
4606 LSRUse &LU = Uses[LUIdx];
4716 LSRUse &LU = Uses[LUIdx];
4723 LSRUse &LU = Uses[LUIdx];
4734 LSRUse &LU = Uses[LUIdx];
4764 LSRUse &LU = Uses[LUIdx];
4852 for (const LSRUse &LU : Uses) {
4877 LSRUse &LU = Uses[LUIdx];
4948 LSRUse &LU = Uses[LUIdx];
4953 LSRUse *LUThatHas = FindUseWithSimilarFormula(F, LU);
5016 /// If a LSRUse has multiple formulae with the same ScaledReg and Scale.
5034 // Map the "Scale * ScaledReg" pair to the best formula of current LSRUse.
5045 LSRUse &LU = Uses[LUIdx];
5131 LSRUse &LU = Uses[LUIdx];
5133 if (LU.Kind != LSRUse::Address)
5226 for (const LSRUse &LU : Uses) {
5243 LSRUse &LU = Uses[LUIdx];
5362 if (LUIdx >= 0 && Uses[LUIdx].Kind == LSRUse::Address &&
5371 assert(Best && "Failed to find best LSRUse candidate");
5380 LSRUse &LU = Uses[LUIdx];
5439 const LSRUse &LU = Uses[Workspace.size()];
5459 if (AMK != TTI::AMK_PostIndexed || LU.Kind != LSRUse::Address) {
5623 BasicBlock::iterator LowestIP, const LSRFixup &LF, const LSRUse &LU) const {
5630 if (LU.Kind == LSRUse::ICmpZero)
5682 /// Emit instructions for the leading candidate expression for this LSRUse (this
5684 Value *LSRInstance::Expand(const LSRUse &LU, const LSRFixup &LF,
5733 if (LU.Kind == LSRUse::ICmpZero) {
5752 if (!Ops.empty() && LU.Kind == LSRUse::Address &&
5793 if (LU.Kind == LSRUse::ICmpZero) {
5829 if (LU.Kind == LSRUse::ICmpZero) {
5869 PHINode *PN, const LSRUse &LU, const LSRFixup &LF, const Formula &F,
5960 for (LSRUse &LU : Uses)
5997 /// Emit instructions for the leading candidate expression for this LSRUse (this
6000 void LSRInstance::Rewrite(const LSRUse &LU, const LSRFixup &LF,
6024 if (LU.Kind == LSRUse::ICmpZero)
6038 const LSRUse &LU, Instruction *IVIncInsertPos,
6040 if (LU.Kind != LSRUse::Address)
6256 for (const LSRUse &LU : Uses) {
6290 for (const LSRUse &LU : Uses)
6300 for (const LSRUse &LU : Uses) {