Lines Matching refs:Basis
93 Stride(nullptr), Ins(nullptr), Basis(nullptr) {} in Candidate()
97 Basis(nullptr) {} in Candidate()
122 Candidate *Basis; member
150 bool isBasisFor(const Candidate &Basis, const Candidate &C);
185 void rewriteCandidateWithBasis(const Candidate &C, const Candidate &Basis);
195 static Value *emitBump(const Candidate &Basis, const Candidate &C,
224 bool StraightLineStrengthReduce::isBasisFor(const Candidate &Basis, in isBasisFor() argument
226 return (Basis.Ins != C.Ins && // skip the same instruction in isBasisFor()
229 Basis.Ins->getType() == C.Ins->getType() && in isBasisFor()
231 DT->dominates(Basis.Ins->getParent(), C.Ins->getParent()) && in isBasisFor()
233 Basis.Base == C.Base && Basis.Stride == C.Stride && in isBasisFor()
234 Basis.CandidateKind == C.CandidateKind); in isBasisFor()
322 for (auto Basis = Candidates.rbegin(); in allocateCandidatesAndFindBasis() local
323 Basis != Candidates.rend() && NumIterations < MaxNumIterations; in allocateCandidatesAndFindBasis()
324 ++Basis, ++NumIterations) { in allocateCandidatesAndFindBasis()
325 if (isBasisFor(*Basis, C)) { in allocateCandidatesAndFindBasis()
326 C.Basis = &(*Basis); in allocateCandidatesAndFindBasis()
537 Value *StraightLineStrengthReduce::emitBump(const Candidate &Basis, in emitBump() argument
542 APInt Idx = C.Index->getValue(), BasisIdx = Basis.Index->getValue(); in emitBump()
547 if (Basis.CandidateKind == Candidate::GEP) { in emitBump()
551 cast<GetElementPtrInst>(Basis.Ins)->getResultElementType())); in emitBump()
571 IntegerType::get(Basis.Ins->getContext(), IndexOffset.getBitWidth()); in emitBump()
589 const Candidate &C, const Candidate &Basis) { in rewriteCandidateWithBasis() argument
590 assert(C.CandidateKind == Basis.CandidateKind && C.Base == Basis.Base && in rewriteCandidateWithBasis()
591 C.Stride == Basis.Stride); in rewriteCandidateWithBasis()
594 assert(Basis.Ins->getParent() != nullptr && "the basis is unlinked"); in rewriteCandidateWithBasis()
605 Value *Bump = emitBump(Basis, C, Builder, DL, BumpWithUglyGEP); in rewriteCandidateWithBasis()
614 Builder.CreateSub(Basis.Ins, BinaryOperator::getNegArgument(Bump)); in rewriteCandidateWithBasis()
628 Reduced = Builder.CreateAdd(Basis.Ins, Bump); in rewriteCandidateWithBasis()
637 unsigned AS = Basis.Ins->getType()->getPointerAddressSpace(); in rewriteCandidateWithBasis()
638 Type *CharTy = Type::getInt8PtrTy(Basis.Ins->getContext(), AS); in rewriteCandidateWithBasis()
639 Reduced = Builder.CreateBitCast(Basis.Ins, CharTy); in rewriteCandidateWithBasis()
651 Reduced = Builder.CreateInBoundsGEP(nullptr, Basis.Ins, Bump); in rewriteCandidateWithBasis()
653 Reduced = Builder.CreateGEP(nullptr, Basis.Ins, Bump); in rewriteCandidateWithBasis()
687 if (C.Basis != nullptr) { in runOnFunction()
688 rewriteCandidateWithBasis(C, *C.Basis); in runOnFunction()