[PATCH] D30638: [SLP] Fixed non-determenistic behavior in Loop Vectorizer.

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 12:43:47 PST 2017


mkuper added inline comments.


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:97
+  typedef SmallVector<MemAccessInfo, 8> MemAccessInfoList;
   typedef SmallPtrSet<MemAccessInfo, 8> MemAccessInfoSet;
   /// \brief Set of potential dependent memory accesses.
----------------
I don't think there's a reason to keep the Set typedef here if the only use is for a local variable.


================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:825
           if ((IsWrite || IsReadOnlyPtr) && SetHasWrite) {
-            CheckDeps.insert(Access);
+            CheckDeps.push_back(Access);
             IsRTCheckAnalysisNeeded = true;
----------------
We never have duplicates here anyway, right? So it doesn't matter if it's a set or a list.


================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:1611
   }
+  CheckDeps.clear();
 
----------------
Is this necessary?
I mean, it used to happen as a side-effect of the way the loop was structured, but is CheckDeps every actually used after this?


https://reviews.llvm.org/D30638





More information about the llvm-commits mailing list