[PATCH] [LoopAccesses 2/3] Allow querying of interesting dependences

hfinkel at anl.gov hfinkel at anl.gov
Sat Mar 7 22:36:28 PST 2015


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:138
@@ +137,3 @@
+      Forward,
+      // Forward but if vectorized is likely to prevent store-to-load
+      // forwarding.
----------------
Forward, but if vectorized, is likely ... (add commas)

================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:143
@@ +142,3 @@
+      Backward,
+      // Backward but the distance allows vectorization factor of
+      // MaxSafeDepDistBytes.
----------------
Backward, but the distance allows a vectorization factor... (add comma and a)

================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:146
@@ +145,3 @@
+      BackwardVectorizable,
+      // Same but may prevent store-to-load forwarding.
+      BackwardVectorizableButPreventsForwarding
----------------
Same, but ...

================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:261
@@ +260,3 @@
+  /// RecordInterestingDependences is true.
+  SmallVector<Dependence, 1> InterestingDependences;
+
----------------
Do you really feel that, most of time time, this holds only 1 entry? Given that `Dependence` is only three integers, I'd recommend something larger (4, 8, 16)?

================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:53
@@ +52,3 @@
+/// \brief We collect interesting dependences up to this threshold.
+const unsigned MaxInterestingDependence = 100;
+
----------------
Please make this a command-line parameter.

================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:798
@@ +797,3 @@
+              std::swap(A, B);
+
+            Dependence::DepType Type =
----------------
I could be mis-remembering how this loop works, but it seems like we're doing twice as much work here as necessary. If there is a forward dependency between A and B, then there's a backward dependence between B and A? If the dependence of A and B is unknown, then the dependence of B and A is unknown. Could we take advantage of that here?

http://reviews.llvm.org/D8114

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list