diff options
author | dim <dim@FreeBSD.org> | 2013-04-23 18:58:39 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-23 18:58:39 +0000 |
commit | 28c80ff39ac4183c05e219f9962f3d58d5e4f8fa (patch) | |
tree | 04933ea9cce5fcd593390bbd8ef38742ede54f78 /contrib/llvm/lib | |
parent | 0f4836399dc2933c7bbcac1f478c3ff628f03d8e (diff) | |
download | FreeBSD-src-28c80ff39ac4183c05e219f9962f3d58d5e4f8fa.zip FreeBSD-src-28c80ff39ac4183c05e219f9962f3d58d5e4f8fa.tar.gz |
Pull in r180121 from upstream llvm trunk:
LoopVectorizer: Fix 15830. When scalarizing and unrolling stores make
sure that the order in which the elements are scalarized is the same
as the original order.
This fixes a miscompilation in FreeBSD's regex library.
This should fix lib/libc/regex/regcomp.c at -O3 with clang 3.3 r178860
on CPUs with SSE. Before this change, the vectorizer could incorrectly
rearrange the second loop in computejumps(), leading to possibly invalid
entries in the re_gets::charjump table.
The net result was that for example "sed s/@CC@/foo/" failed to work
correctly, leading to trouble with many configure scripts.
Diffstat (limited to 'contrib/llvm/lib')
-rw-r--r-- | contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index acf2b81..8d51df4 100644 --- a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1040,10 +1040,10 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr) { // Create a new entry in the WidenMap and initialize it to Undef or Null. VectorParts &VecResults = WidenMap.splat(Instr, UndefVec); - // For each scalar that we create: - for (unsigned Width = 0; Width < VF; ++Width) { - // For each vector unroll 'part': - for (unsigned Part = 0; Part < UF; ++Part) { + // For each vector unroll 'part': + for (unsigned Part = 0; Part < UF; ++Part) { + // For each scalar that we create: + for (unsigned Width = 0; Width < VF; ++Width) { Instruction *Cloned = Instr->clone(); if (!IsVoidRetTy) Cloned->setName(Instr->getName() + ".cloned"); |