Hi adam, one of these changes has broken the lldb bot, can you ptal?<br><br><a href="http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc">http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc</a><br><div class="gmail_quote">On Tue, Feb 17, 2015 at 8:05 PM Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: anemet<br>
Date: Tue Feb 17 21:44:33 2015<br>
New Revision: 229634<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=229634&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=229634&view=rev</a><br>
Log:<br>
[LoopAccesses] Change LAA:getInfo to return a constant reference<br>
<br>
As expected, this required a few more const-correctness fixes.<br>
<br>
Based on Hal's feedback on D7684.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/<u></u>Analysis/LoopAccessAnalysis.h<br>
    llvm/trunk/lib/Analysis/<u></u>LoopAccessAnalysis.cpp<br>
    llvm/trunk/lib/Transforms/<u></u>Vectorize/LoopVectorize.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/<u></u>Analysis/LoopAccessAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h?rev=229634&r1=229633&r2=229634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/include/<u></u>llvm/Analysis/<u></u>LoopAccessAnalysis.h?rev=<u></u>229634&r1=229633&r2=229634&<u></u>view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/include/llvm/<u></u>Analysis/LoopAccessAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/<u></u>Analysis/LoopAccessAnalysis.h Tue Feb 17 21:44:33 2015<br>
@@ -153,9 +153,11 @@ public:<br>
<br>
   /// Return true we can analyze the memory accesses in the loop and there are<br>
   /// no memory dependence cycles.<br>
-  bool canVectorizeMemory() { return CanVecMem; }<br>
+  bool canVectorizeMemory() const { return CanVecMem; }<br>
<br>
-  RuntimePointerCheck *getRuntimePointerCheck() { return &PtrRtCheck; }<br>
+  const RuntimePointerCheck *getRuntimePointerCheck() const {<br>
+    return &PtrRtCheck;<br>
+  }<br>
<br>
   /// Return true if the block BB needs to be predicated in order for the loop<br>
   /// to be vectorized.<br>
@@ -163,7 +165,7 @@ public:<br>
                                     DominatorTree *DT);<br>
<br>
   /// Returns true if the value V is uniform within the loop.<br>
-  bool isUniform(Value *V);<br>
+  bool isUniform(Value *V) const;<br>
<br>
   unsigned getMaxSafeDepDistBytes() const { return MaxSafeDepDistBytes; }<br>
   unsigned getNumStores() const { return NumStores; }<br>
@@ -174,11 +176,12 @@ public:<br>
   /// Returns a pair of instructions where the first element is the first<br>
   /// instruction generated in possibly a sequence of instructions and the<br>
   /// second value is the final comparator value or NULL if no check is needed.<br>
-  std::pair<Instruction *, Instruction *> addRuntimeCheck(Instruction *Loc);<br>
+  std::pair<Instruction *, Instruction *><br>
+    addRuntimeCheck(Instruction *Loc) const;<br>
<br>
   /// \brief The diagnostics report generated for the analysis.  E.g. why we<br>
   /// couldn't analyze the loop.<br>
-  Optional<LoopAccessReport> &getReport() { return Report; }<br>
+  const Optional<LoopAccessReport> &getReport() const { return Report; }<br>
<br>
   /// \brief Print the information about the memory accesses in the loop.<br>
   void print(raw_ostream &OS, unsigned Depth = 0) const;<br>
@@ -258,7 +261,7 @@ public:<br>
   /// of symbolic strides, \p Strides provides the mapping (see<br>
   /// replaceSymbolicStrideSCEV).  If there is no cached result available run<br>
   /// the analysis.<br>
-  LoopAccessInfo &getInfo(Loop *L, ValueToValueMap &Strides);<br>
+  const LoopAccessInfo &getInfo(Loop *L, ValueToValueMap &Strides);<br>
<br>
   void releaseMemory() override {<br>
     // Invalidate the cache when the pass is freed.<br>
<br>
Modified: llvm/trunk/lib/Analysis/<u></u>LoopAccessAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=229634&r1=229633&r2=229634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Analysis/LoopAccessAnalysis.<u></u>cpp?rev=229634&r1=229633&r2=<u></u>229634&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Analysis/<u></u>LoopAccessAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/<u></u>LoopAccessAnalysis.cpp Tue Feb 17 21:44:33 2015<br>
@@ -1173,7 +1173,7 @@ void LoopAccessInfo::emitAnalysis(<u></u>LoopAc<br>
   Report = Message;<br>
 }<br>
<br>
-bool LoopAccessInfo::isUniform(<u></u>Value *V) {<br>
+bool LoopAccessInfo::isUniform(<u></u>Value *V) const {<br>
   return (SE->isLoopInvariant(SE-><u></u>getSCEV(V), TheLoop));<br>
 }<br>
<br>
@@ -1189,7 +1189,7 @@ static Instruction *getFirstInst(Instruc<br>
 }<br>
<br>
 std::pair<Instruction *, Instruction *><br>
-LoopAccessInfo::<u></u>addRuntimeCheck(Instruction *Loc) {<br>
+LoopAccessInfo::<u></u>addRuntimeCheck(Instruction *Loc) const {<br>
   Instruction *tnullptr = nullptr;<br>
   if (!PtrRtCheck.Need)<br>
     return std::pair<Instruction *, Instruction *>(tnullptr, tnullptr);<br>
@@ -1301,7 +1301,8 @@ void LoopAccessInfo::print(raw_<u></u>ostream &<br>
   OS << "\n";<br>
 }<br>
<br>
-LoopAccessInfo &LoopAccessAnalysis::getInfo(<u></u>Loop *L, ValueToValueMap &Strides) {<br>
+const LoopAccessInfo &LoopAccessAnalysis::getInfo(<u></u>Loop *L,<br>
+                                                  ValueToValueMap &Strides) {<br>
   auto &LAI = LoopAccessInfoMap[L];<br>
<br>
 #ifndef NDEBUG<br>
<br>
Modified: llvm/trunk/lib/Transforms/<u></u>Vectorize/LoopVectorize.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=229634&r1=229633&r2=229634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Transforms/Vectorize/<u></u>LoopVectorize.cpp?rev=229634&<u></u>r1=229633&r2=229634&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Transforms/<u></u>Vectorize/LoopVectorize.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/<u></u>Vectorize/LoopVectorize.cpp Tue Feb 17 21:44:33 2015<br>
@@ -756,11 +756,11 @@ public:<br>
   bool isUniformAfterVectorization(<u></u>Instruction* I) { return Uniforms.count(I); }<br>
<br>
   /// Returns the information that we collected about runtime memory check.<br>
-  LoopAccessInfo::<u></u>RuntimePointerCheck *getRuntimePointerCheck() {<br>
+  const LoopAccessInfo::<u></u>RuntimePointerCheck *getRuntimePointerCheck() const {<br>
     return LAI->getRuntimePointerCheck();<br>
   }<br>
<br>
-  LoopAccessInfo *getLAI() {<br>
+  const LoopAccessInfo *getLAI() const {<br>
     return LAI;<br>
   }<br>
<br>
@@ -877,7 +877,7 @@ private:<br>
   LoopAccessAnalysis *LAA;<br>
   // And the loop-accesses info corresponding to this loop.  This pointer is<br>
   // null until canVectorizeMemory sets it up.<br>
-  LoopAccessInfo *LAI;<br>
+  const LoopAccessInfo *LAI;<br>
<br>
   //  ---  vectorization state --- //<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>