svn commit: r275742 - in stable: 10/contrib/llvm/lib/Transforms/Vectorize 10/sys/sys 9/contrib/llvm/lib/Transforms/Vectorize 9/sys/sys
Steven Hartland
steven at multiplay.co.uk
Sun Dec 14 14:56:32 UTC 2014
Sounds nasty, is this something that only effects stable/10 or does it
also effects 10.1-RELEASE?
On 13/12/2014 12:14, Dimitry Andric wrote:
> Author: dim
> Date: Sat Dec 13 12:14:26 2014
> New Revision: 275742
> URL: https://svnweb.freebsd.org/changeset/base/275742
>
> Log:
> MFC r275633:
>
> Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
>
> PR21302. Vectorize only bottom-tested loops.
>
> rdar://problem/18886083
>
> This fixes a bug in the llvm vectorizer, which could sometimes cause
> vectorized loops to perform an additional iteration, leading to possible
> buffer overruns. Symptoms of this, which are usually segfaults, were
> first noticed when building gcc ports, here:
>
> https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
> https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html
>
> Since this fix is very important for ports, bump __FreeBSD_version to
> make it easier for port maintainers to test whether the fix has been
> applied.
>
> Upstream PR: http://llvm.org/PR21302
>
> Modified:
> stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
> stable/10/sys/sys/param.h
> Directory Properties:
> stable/10/ (props changed)
>
> Changes in other areas also in this revision:
> Modified:
> stable/9/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
> stable/9/sys/sys/param.h
> Directory Properties:
> stable/9/contrib/llvm/ (props changed)
> stable/9/sys/ (props changed)
>
> Modified: stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
> ==============================================================================
> --- stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 04:50:14 2014 (r275741)
> +++ stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Sat Dec 13 12:14:26 2014 (r275742)
> @@ -2864,6 +2864,14 @@ bool LoopVectorizationLegality::canVecto
> if (!TheLoop->getExitingBlock())
> return false;
>
> + // We only handle bottom-tested loops, i.e. loop in which the condition is
> + // checked at the end of each iteration. With that we can assume that all
> + // instructions in the loop are executed the same number of times.
> + if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) {
> + DEBUG(dbgs() << "LV: loop control flow is not understood by vectorizer\n");
> + return false;
> + }
> +
> // We need to have a loop header.
> DEBUG(dbgs() << "LV: Found a loop: " <<
> TheLoop->getHeader()->getName() << '\n');
>
> Modified: stable/10/sys/sys/param.h
> ==============================================================================
> --- stable/10/sys/sys/param.h Sat Dec 13 04:50:14 2014 (r275741)
> +++ stable/10/sys/sys/param.h Sat Dec 13 12:14:26 2014 (r275742)
> @@ -58,7 +58,7 @@
> * in the range 5 to 9.
> */
> #undef __FreeBSD_version
> -#define __FreeBSD_version 1001503 /* Master, propagated to newvers */
> +#define __FreeBSD_version 1001504 /* Master, propagated to newvers */
>
> /*
> * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
>
More information about the svn-src-stable-10
mailing list