[PATCH] [LoopAccesses] Create the analysis pass

hfinkel at anl.gov hfinkel at anl.gov
Mon Feb 16 16:38:51 PST 2015


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:183
@@ -179,1 +182,3 @@
   Optional<VectorizationReport> Report;
+#ifndef NDEBUG
+  /// \brief Used to ensure that if the analysis was run with speculating the
----------------
We should be careful here; having an NDEBUG-dependent ABI is not necessarily desirable (and people complain about them). I believe there is currently a patch out for review to make our ABI non-NDEBUG-dependent. I'm not overly concerned about the size of this class (we won't have that many of them), so we may just want to always have this.

(may need to make it public, however, so that you don't get compiler warnings in -Asserts builds).

================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:227
@@ +226,3 @@
+  /// the analysis.
+  LoopAccessInfo *getInfo(Loop *L, ValueToValueMap &Strides);
+
----------------
Returning a pointer seems odd here, who owns it? Should it be const?

================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:1225
@@ +1224,3 @@
+  DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
+  DL = DLP ? &DLP->getDataLayout() : nullptr;
+  auto *TLIP = getAnalysisIfAvailable<TargetLibraryInfoWrapperPass>();
----------------
You can just grab DL, if available, from the Module. I think that's the "modern" way.

http://reviews.llvm.org/D7684

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






More information about the llvm-commits mailing list