[llvm] r233930 - [LoopAccesses] Handle case when no memchecks are needed after partitioning

Adam Nemet anemet at apple.com
Thu Apr 2 11:09:39 PDT 2015


> On Apr 2, 2015, at 11:05 AM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> Test case? Or is this just a perf improvement?

No it’s a bug fix because without this check we will use the null MemoryRuntimeCheck later. 

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?

Adam

> On Thu, Apr 2, 2015 at 10:51 AM, Adam Nemet <anemet at apple.com <mailto:anemet at apple.com>> wrote:
> Author: anemet
> Date: Thu Apr  2 12:51:57 2015
> New Revision: 233930
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=233930&view=rev <http://llvm.org/viewvc/llvm-project?rev=233930&view=rev>
> Log:
> [LoopAccesses] Handle case when no memchecks are needed after partitioning
> 
> Modified:
>     llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
> 
> Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=233930&r1=233929&r2=233930&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=233930&r1=233929&r2=233930&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
> +++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Thu Apr  2 12:51:57 2015
> @@ -1211,9 +1211,8 @@ static Instruction *getFirstInst(Instruc
> 
>  std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeCheck(
>      Instruction *Loc, const SmallVectorImpl<int> *PtrPartition) const {
> -  Instruction *tnullptr = nullptr;
>    if (!PtrRtCheck.Need)
> -    return std::pair<Instruction *, Instruction *>(tnullptr, tnullptr);
> +    return std::make_pair(nullptr, nullptr);
> 
>    unsigned NumPointers = PtrRtCheck.Pointers.size();
>    SmallVector<TrackingVH<Value> , 2> Starts;
> @@ -1284,6 +1283,9 @@ std::pair<Instruction *, Instruction *>
>      }
>    }
> 
> +  if (!MemoryRuntimeCheck)
> +    return std::make_pair(nullptr, nullptr);
> +
>    // We have to do this trickery because the IRBuilder might fold the check to a
>    // constant expression in which case there is no Instruction anchored in a
>    // the block.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150402/750fe31c/attachment.html>


More information about the llvm-commits mailing list