<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 11:09 AM, Adam Nemet <span dir="ltr"><<a href="mailto:anemet@apple.com" target="_blank">anemet@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Apr 2, 2015, at 11:05 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Test case? Or is this just a perf improvement?</div></div></blockquote><div><br></div></span><div>No it’s a bug fix because without this check we will use the null MemoryRuntimeCheck later. </div><div><br></div><div>There should be a way to come up with a testcase even without Loop Distribution but it should be much easier with Loop Distribution.  Let me add a testcase for this as part of the LDist patch.  OK?</div></div></div></blockquote><div><br>Sure - follow up here with the revision the test is committed in?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Adam</div></font></span><div><div class="h5"><br><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 2, 2015 at 10:51 AM, Adam Nemet <span dir="ltr"><<a href="mailto:anemet@apple.com" target="_blank">anemet@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: anemet<br>
Date: Thu Apr  2 12:51:57 2015<br>
New Revision: 233930<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=233930&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=233930&view=rev</a><br>
Log:<br>
[LoopAccesses] Handle case when no memchecks are needed after partitioning<br>
<br>
Modified:<br>
    llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp<br>
<br>
Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=233930&r1=233929&r2=233930&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=233930&r1=233929&r2=233930&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Thu Apr  2 12:51:57 2015<br>
@@ -1211,9 +1211,8 @@ static Instruction *getFirstInst(Instruc<br>
<br>
 std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeCheck(<br>
     Instruction *Loc, const SmallVectorImpl<int> *PtrPartition) const {<br>
-  Instruction *tnullptr = nullptr;<br>
   if (!PtrRtCheck.Need)<br>
-    return std::pair<Instruction *, Instruction *>(tnullptr, tnullptr);<br>
+    return std::make_pair(nullptr, nullptr);<br>
<br>
   unsigned NumPointers = PtrRtCheck.Pointers.size();<br>
   SmallVector<TrackingVH<Value> , 2> Starts;<br>
@@ -1284,6 +1283,9 @@ std::pair<Instruction *, Instruction *><br>
     }<br>
   }<br>
<br>
+  if (!MemoryRuntimeCheck)<br>
+    return std::make_pair(nullptr, nullptr);<br>
+<br>
   // We have to do this trickery because the IRBuilder might fold the check to a<br>
   // constant expression in which case there is no Instruction anchored in a<br>
   // the block.<br>
<br>
<br>
_______________________________________________<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/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>