Lines Matching defs:Src

188           OS << "Src:" << *SrcI << " --> Dst:" << *DstI << "\n";
231 return Src->mayReadFromMemory() && Dst->mayReadFromMemory();
237 return Src->mayWriteToMemory() && Dst->mayWriteToMemory();
243 return Src->mayWriteToMemory() && Dst->mayReadFromMemory();
249 return Src->mayReadFromMemory() && Dst->mayWriteToMemory();
278 // Src: A[i] = ...;
282 // flow { Src[i] -> Dst[31 - i] : when i >= 16 } and
283 // anti { Dst[i] -> Src[31 - i] : when i < 16 },
309 std::swap(Src, Dst);
759 // Examines the loop nesting of the Src and Dst
776 // ... - loops containing Src but not Dst
777 // SrcLevels - innermost loop containing Src but not Dst
778 // ... - loops containing Dst but not Src
779 // MaxLevels - innermost loops containing Dst but not Src
798 // to A (the Src) and the load from A (the Dst), we'll note that they
809 void DependenceInfo::establishNestingLevels(const Instruction *Src,
811 const BasicBlock *SrcBlock = Src->getParent();
895 const SCEV *Src = Pair->Src;
897 IntegerType *SrcTy = dyn_cast<IntegerType>(Src->getType());
901 "expect Src and Dst share the same type "
920 const SCEV *Src = Pair->Src;
922 IntegerType *SrcTy = dyn_cast<IntegerType>(Src->getType());
926 "expect Src and Dst share the same type "
931 // Sign-extend Src to widestType
932 Pair->Src = SE->getSignExtendExpr(Src, widestType);
945 const SCEV *Src = Pair->Src;
947 if ((isa<SCEVZeroExtendExpr>(Src) && isa<SCEVZeroExtendExpr>(Dst)) ||
948 (isa<SCEVSignExtendExpr>(Src) && isa<SCEVSignExtendExpr>(Dst))) {
949 const SCEVIntegralCastExpr *SrcCast = cast<SCEVIntegralCastExpr>(Src);
954 Pair->Src = SrcCastOp;
1000 bool DependenceInfo::checkSrcSubscript(const SCEV *Src, const Loop *LoopNest,
1002 return checkSubscript(Src, LoopNest, Loops, true);
1013 // Examines the subscript pair (the Src and Dst SCEVs)
1017 DependenceInfo::classifyPair(const SCEV *Src, const Loop *SrcLoopNest,
1022 if (!checkSrcSubscript(Src, SrcLoopNest, SrcLoops))
1183 bool DependenceInfo::testZIV(const SCEV *Src, const SCEV *Dst,
1185 LLVM_DEBUG(dbgs() << " src = " << *Src << "\n");
1188 if (isKnownPredicate(CmpInst::ICMP_EQ, Src, Dst)) {
1192 if (isKnownPredicate(CmpInst::ICMP_NE, Src, Dst)) {
1564 // only tested whether Dst depends on Src. This algorithm extends that and
1565 // returns all the dependencies that exist between Dst and Src.
1766 // the Src and Dst loops. If it isn't, then there's no need to
1876 // Src and Dst loops. If it isn't, then there's no need to record a direction.
2226 bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level,
2229 LLVM_DEBUG(dbgs() << " src = " << *Src << "\n");
2231 const SCEVAddRecExpr *SrcAddRec = dyn_cast<SCEVAddRecExpr>(Src);
2253 gcdMIVtest(Src, Dst, Result) ||
2264 gcdMIVtest(Src, Dst, Result);
2269 const SCEV *SrcConst = Src;
2274 gcdMIVtest(Src, Dst, Result);
2294 bool DependenceInfo::testRDIV(const SCEV *Src, const SCEV *Dst,
2306 LLVM_DEBUG(dbgs() << " src = " << *Src << "\n");
2308 const SCEVAddRecExpr *SrcAddRec = dyn_cast<SCEVAddRecExpr>(Src);
2337 SrcConst = Src;
2350 gcdMIVtest(Src, Dst, Result) ||
2357 // Tests the single-subscript MIV pair (Src and Dst) for dependence.
2360 bool DependenceInfo::testMIV(const SCEV *Src, const SCEV *Dst,
2363 LLVM_DEBUG(dbgs() << " src = " << *Src << "\n");
2366 return gcdMIVtest(Src, Dst, Result) ||
2367 banerjeeMIVtest(Src, Dst, Loops, Result);
2402 bool DependenceInfo::gcdMIVtest(const SCEV *Src, const SCEV *Dst,
2406 unsigned BitWidth = SE->getTypeSizeInBits(Src->getType());
2409 // Examine Src coefficients.
2413 const SCEV *Coefficients = Src;
2502 Coefficients = Src;
2510 const SCEV *Inner = Src;
2605 bool DependenceInfo::banerjeeMIVtest(const SCEV *Src, const SCEV *Dst,
2610 LLVM_DEBUG(dbgs() << " Src = " << *Src << '\n');
2612 CoefficientInfo *A = collectCoeffInfo(Src, true, A0);
3144 // to simplify a subscript pair (Src and Dst).
3153 bool DependenceInfo::propagate(const SCEV *&Src, const SCEV *&Dst,
3162 Result |= propagateDistance(Src, Dst, Constraints[LI], Consistent);
3164 Result |= propagateLine(Src, Dst, Constraints[LI], Consistent);
3166 Result |= propagatePoint(Src, Dst, Constraints[LI]);
3173 // constraint into a subscript pair (Src and Dst).
3177 bool DependenceInfo::propagateDistance(const SCEV *&Src, const SCEV *&Dst,
3181 LLVM_DEBUG(dbgs() << "\t\tSrc is " << *Src << "\n");
3182 const SCEV *A_K = findCoefficient(Src, CurLoop);
3186 Src = SE->getMinusSCEV(Src, DA_K);
3187 Src = zeroCoefficient(Src, CurLoop);
3188 LLVM_DEBUG(dbgs() << "\t\tnew Src is " << *Src << "\n");
3199 // constraint into a subscript pair (Src and Dst).
3203 bool DependenceInfo::propagateLine(const SCEV *&Src, const SCEV *&Dst,
3212 LLVM_DEBUG(dbgs() << "\t\tSrc = " << *Src << "\n");
3223 // Src = SE->getAddExpr(Src, SE->getMulExpr(AP_K, SE->getConstant(CdivB)));
3224 Src = SE->getMinusSCEV(Src, SE->getMulExpr(AP_K, SE->getConstant(CdivB)));
3226 if (!findCoefficient(Src, CurLoop)->isZero())
3237 const SCEV *A_K = findCoefficient(Src, CurLoop);
3238 Src = SE->getAddExpr(Src, SE->getMulExpr(A_K, SE->getConstant(CdivA)));
3239 Src = zeroCoefficient(Src, CurLoop);
3251 const SCEV *A_K = findCoefficient(Src, CurLoop);
3252 Src = SE->getAddExpr(Src, SE->getMulExpr(A_K, SE->getConstant(CdivA)));
3253 Src = zeroCoefficient(Src, CurLoop);
3260 const SCEV *A_K = findCoefficient(Src, CurLoop);
3261 Src = SE->getMulExpr(Src, A);
3263 Src = SE->getAddExpr(Src, SE->getMulExpr(A_K, C));
3264 Src = zeroCoefficient(Src, CurLoop);
3269 LLVM_DEBUG(dbgs() << "\t\tnew Src = " << *Src << "\n");
3276 // constraint into a subscript pair (Src and Dst).
3278 bool DependenceInfo::propagatePoint(const SCEV *&Src, const SCEV *&Dst,
3281 const SCEV *A_K = findCoefficient(Src, CurLoop);
3285 LLVM_DEBUG(dbgs() << "\t\tSrc is " << *Src << "\n");
3286 Src = SE->getAddExpr(Src, SE->getMinusSCEV(XA_K, YAP_K));
3287 Src = zeroCoefficient(Src, CurLoop);
3288 LLVM_DEBUG(dbgs() << "\t\tnew Src is " << *Src << "\n");
3350 bool DependenceInfo::tryDelinearize(Instruction *Src, Instruction *Dst,
3352 assert(isLoadOrStore(Src) && "instruction is not load or store");
3354 Value *SrcPtr = getLoadStorePointerOperand(Src);
3356 Loop *SrcLoop = LI->getLoopFor(Src->getParent());
3370 if (!tryDelinearizeFixedSize(Src, Dst, SrcAccessFn, DstAccessFn,
3372 !tryDelinearizeParametricSize(Src, Dst, SrcAccessFn, DstAccessFn,
3392 Pair[I].Src = SrcSubscripts[I];
3404 Instruction *Src, Instruction *Dst, const SCEV *SrcAccessFn,
3418 if (!tryDelinearizeFixedSizeImpl(SE, Src, SrcAccessFn, SrcSubscripts,
3437 Value *SrcPtr = getLoadStorePointerOperand(Src);
3481 Instruction *Src, Instruction *Dst, const SCEV *SrcAccessFn,
3485 Value *SrcPtr = getLoadStorePointerOperand(Src);
3494 const SCEV *ElementSize = SE->getElementSize(Src);
3590 DependenceInfo::depends(Instruction *Src, Instruction *Dst,
3592 if (Src == Dst)
3595 if (!(Src->mayReadOrWriteMemory() && Dst->mayReadOrWriteMemory()))
3599 if (!isLoadOrStore(Src) || !isLoadOrStore(Dst)) {
3602 return std::make_unique<Dependence>(Src, Dst);
3605 assert(isLoadOrStore(Src) && "instruction is not load or store");
3607 Value *SrcPtr = getLoadStorePointerOperand(Src);
3612 MemoryLocation::get(Src))) {
3617 return std::make_unique<Dependence>(Src, Dst);
3627 establishNestingLevels(Src, Dst);
3631 FullDependence Result(Src, Dst, PossiblyLoopIndependent, CommonLevels);
3648 return std::make_unique<Dependence>(Src, Dst);
3650 Pair[0].Src = SrcSCEV;
3654 if (tryDelinearize(Src, Dst, Pair)) {
3666 classifyPair(Pair[P].Src, LI->getLoopFor(Src->getParent()),
3672 LLVM_DEBUG(dbgs() << "\tsrc = " << *Pair[P].Src << "\n");
3712 // Src Dst Classification Loops GroupLoops Group
3743 collectCommonLoops(Pair[SI].Src,
3744 LI->getLoopFor(Src->getParent()),
3795 if (testZIV(Pair[SI].Src, Pair[SI].Dst, Result))
3802 if (testSIV(Pair[SI].Src, Pair[SI].Dst, Level, Result, NewConstraint,
3809 if (testRDIV(Pair[SI].Src, Pair[SI].Dst, Result))
3814 if (testMIV(Pair[SI].Src, Pair[SI].Dst, Pair[SI].Loops, Result))
3854 if (testSIV(Pair[SJ].Src, Pair[SJ].Dst, Level, Result, NewConstraint,
3875 if (propagate(Pair[SJ].Src, Pair[SJ].Dst, Pair[SJ].Loops,
3880 classifyPair(Pair[SJ].Src, LI->getLoopFor(Src->getParent()),
3886 if (testZIV(Pair[SJ].Src, Pair[SJ].Dst, Result))
3909 if (testRDIV(Pair[SJ].Src, Pair[SJ].Dst, Result))
3922 if (testMIV(Pair[SJ].Src, Pair[SJ].Dst, Pair[SJ].Loops, Result))
4028 Instruction *Src = Dep.getSrc();
4030 assert(Src->mayReadFromMemory() || Src->mayWriteToMemory());
4032 assert(isLoadOrStore(Src));
4034 Value *SrcPtr = getLoadStorePointerOperand(Src);
4038 MemoryLocation::get(Src)) == AliasResult::MustAlias);
4041 establishNestingLevels(Src, Dst);
4043 FullDependence Result(Src, Dst, false, CommonLevels);
4049 Pair[0].Src = SrcSCEV;
4053 if (tryDelinearize(Src, Dst, Pair)) {
4065 classifyPair(Pair[P].Src, LI->getLoopFor(Src->getParent()),
4079 collectCommonLoops(Pair[SI].Src,
4080 LI->getLoopFor(Src->getParent()),
4121 (void) testSIV(Pair[SI].Src, Pair[SI].Dst, Level,
4160 (void) testSIV(Pair[SJ].Src, Pair[SJ].Dst, Level,
4173 if (propagate(Pair[SJ].Src, Pair[SJ].Dst,
4176 classifyPair(Pair[SJ].Src, LI->getLoopFor(Src->getParent()),