Lines Matching refs:Basis

91           Stride(nullptr), Ins(nullptr), Basis(nullptr) {}  in Candidate()
95 Basis(nullptr) {} in Candidate()
120 Candidate *Basis; member
148 bool isBasisFor(const Candidate &Basis, const Candidate &C);
183 void rewriteCandidateWithBasis(const Candidate &C, const Candidate &Basis);
193 static Value *emitBump(const Candidate &Basis, const Candidate &C,
222 bool StraightLineStrengthReduce::isBasisFor(const Candidate &Basis, in isBasisFor() argument
224 return (Basis.Ins != C.Ins && // skip the same instruction in isBasisFor()
226 DT->dominates(Basis.Ins->getParent(), C.Ins->getParent()) && in isBasisFor()
228 Basis.Base == C.Base && in isBasisFor()
229 Basis.Stride == C.Stride && in isBasisFor()
230 Basis.CandidateKind == C.CandidateKind); in isBasisFor()
344 for (auto Basis = Candidates.rbegin(); in allocateCandidatesAndFindBasis() local
345 Basis != Candidates.rend() && NumIterations < MaxNumIterations; in allocateCandidatesAndFindBasis()
346 ++Basis, ++NumIterations) { in allocateCandidatesAndFindBasis()
347 if (isBasisFor(*Basis, C)) { in allocateCandidatesAndFindBasis()
348 C.Basis = &(*Basis); in allocateCandidatesAndFindBasis()
529 Value *StraightLineStrengthReduce::emitBump(const Candidate &Basis, in emitBump() argument
534 APInt Idx = C.Index->getValue(), BasisIdx = Basis.Index->getValue(); in emitBump()
539 if (Basis.CandidateKind == Candidate::GEP) { in emitBump()
543 cast<GetElementPtrInst>(Basis.Ins)->getType()->getElementType())); in emitBump()
563 IntegerType::get(Basis.Ins->getContext(), IndexOffset.getBitWidth()); in emitBump()
581 const Candidate &C, const Candidate &Basis) { in rewriteCandidateWithBasis() argument
582 assert(C.CandidateKind == Basis.CandidateKind && C.Base == Basis.Base && in rewriteCandidateWithBasis()
583 C.Stride == Basis.Stride); in rewriteCandidateWithBasis()
586 assert(Basis.Ins->getParent() != nullptr && "the basis is unlinked"); in rewriteCandidateWithBasis()
597 Value *Bump = emitBump(Basis, C, Builder, DL, BumpWithUglyGEP); in rewriteCandidateWithBasis()
604 Builder.CreateSub(Basis.Ins, BinaryOperator::getNegArgument(Bump)); in rewriteCandidateWithBasis()
606 Reduced = Builder.CreateAdd(Basis.Ins, Bump); in rewriteCandidateWithBasis()
615 unsigned AS = Basis.Ins->getType()->getPointerAddressSpace(); in rewriteCandidateWithBasis()
616 Type *CharTy = Type::getInt8PtrTy(Basis.Ins->getContext(), AS); in rewriteCandidateWithBasis()
617 Reduced = Builder.CreateBitCast(Basis.Ins, CharTy); in rewriteCandidateWithBasis()
629 Reduced = Builder.CreateInBoundsGEP(nullptr, Basis.Ins, Bump); in rewriteCandidateWithBasis()
631 Reduced = Builder.CreateGEP(nullptr, Basis.Ins, Bump); in rewriteCandidateWithBasis()
666 if (C.Basis != nullptr) { in runOnFunction()
667 rewriteCandidateWithBasis(C, *C.Basis); in runOnFunction()