[PATCH] D28044: [LV/LoopAccess] Check statically if an unknown dependence distance can be proven larger than the loop-count

Dorit Nuzman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 00:35:22 PST 2017


dorit added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1310
+      // (this is equivalent to what the SIV data-dependence test would do).
+      const SCEV *BackedgeTakenCount = PSE.getBackedgeTakenCount();
+      const uint64_t ByteStride = Stride * TypeByteSize;
----------------
dorit wrote:
> mkuper wrote:
> > Can you use getMaxBackedgeTakenCount()?
> > If the count is precisely known, then they should be equivalent. If it's not, then since by definition MaxBackedgeTakenCount >= BackedgeTakenCount, the equation above also holds.
> > 
> > (I'm not sure if ever vectorize when we don't have a precise getBackedgeTakenCount(), but even if we don't, no need for extra constraints here)
> Ok; I gave this a try, but getMaxBackedgeTakenCount is giving me -1… maybe I'm using it wrong?:
> Const SCEV *MaxBackedgeTakenCount = PSE.getSE()->getMaxBackedgeTakenCount(InnermostLoop);
> 
> I don't see any uses of this API in the vectorizer/LoopAccesses; is it supposed to work also when predicates are added to compute the BackedgeCount?
> 
> (BTW, we indeed never get here if getBackedgeTakenCount is UnknownSCEV. it' a requirement in canAnalyzeLoop).
>  getMaxBackedgeTakenCount is giving me -1

probably this related to the PR you opened (PR31412)? (although this is not in the remainder loop...?)


https://reviews.llvm.org/D28044





More information about the llvm-commits mailing list