[llvm-commits] PR8753

Nick Lewycky nicholas at mxc.ca
Wed Dec 8 20:14:29 PST 2010


Jakub Staszak wrote:
> Proposed patch for PR8753.
>
>
> --- lib/Transforms/Scalar/MemCpyOptimizer.cpp	(revision 121189)
> +++ lib/Transforms/Scalar/MemCpyOptimizer.cpp	(working copy)
> @@ -674,6 +674,14 @@
>     // other.
>     if (M->getSource() != MDep->getDest() || MDep->isVolatile())
>       return false;
> +
> +  // If dep instruction can be easily removed, don't bother. It also prevents
> +  // from infinie calculation for:

Typo "infinie"

Nick

> +  //    memcpy(a<- a)
> +  //    memcpy(b<- a)
> +  // See: PR8753
> +  if (MDep->getSource() == MDep->getDest())
> +    return false;
>
>     // Second, the length of the memcpy's must be the same, or the preceeding one
>     // must be larger than the following one.
>
>




More information about the llvm-commits mailing list