[PATCH] D54538: [LV] Avoid vectorizing unsafe dependencies in uniform address

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 15 06:32:21 PST 2018


anna added inline comments.


================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:1927
+        UniformStores.find(Ptr) != UniformStores.end() &&
+        !DT->dominates(UniformStoreMap[Ptr], LD)) {
+      LLVM_DEBUG(dbgs() << "LAA: Found an unsafe dependency between a uniform "
----------------
Ayal wrote:
> efriedma wrote:
> > I'm not sure the dominance check is sufficient. Yes, if the store dominates the load, it's theoretically possible to vectorize the loop, but only if vectorizer has a special case to forward the stored values to the load.  Otherwise, the load will get values from the wrong loop iteration.
> Ahh, right! No special forwarding provided. Only the last of the VF stores to same address will survive, and it will feed all VF loads.
> 
> As @anna originally intended: if an invariant address is both stored-to and loaded-from, inside the loop, bail out.
> 
> So can continue to use the `ValueSet UniformStores`;
oh yes, that's right. I'll resurrect the older one. 


Repository:
  rL LLVM

https://reviews.llvm.org/D54538





More information about the llvm-commits mailing list