diff options
author | Michael Kuperstein <mkuper@google.com> | 2016-08-30 20:22:21 +0000 |
---|---|---|
committer | Michael Kuperstein <mkuper@google.com> | 2016-08-30 20:22:21 +0000 |
commit | 2954d1db77e5ddedd428c78c61a2a3d11841fda7 (patch) | |
tree | 73a48a931dcfcb9d74dbd43b94d91e6032b0ffdf /llvm/lib/Transforms | |
parent | ac8cfab51fe45b1b69931b50a1c91ac408a3ea63 (diff) | |
download | bcm5719-llvm-2954d1db77e5ddedd428c78c61a2a3d11841fda7.tar.gz bcm5719-llvm-2954d1db77e5ddedd428c78c61a2a3d11841fda7.zip |
[LoopVectorizer] Predicate instructions in blocks with several incoming edges
We don't need to limit predication to blocks that have a single incoming
edge, we just need to use the right mask.
This fixes PR30172.
Differential Revision: https://reviews.llvm.org/D24009
llvm-svn: 280148
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 62b1339138f..3e57360cd23 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2930,12 +2930,8 @@ void InnerLoopVectorizer::scalarizeInstruction(Instruction *Instr, ScalarParts Entry(UF); VectorParts Cond; - if (IfPredicateInstr) { - assert(Instr->getParent()->getSinglePredecessor() && - "Only support single predecessor blocks"); - Cond = createEdgeMask(Instr->getParent()->getSinglePredecessor(), - Instr->getParent()); - } + if (IfPredicateInstr) + Cond = createBlockInMask(Instr->getParent()); // For each vector unroll 'part': for (unsigned Part = 0; Part < UF; ++Part) { @@ -6697,12 +6693,8 @@ void InnerLoopUnroller::scalarizeInstruction(Instruction *Instr, ScalarParts Entry(UF); VectorParts Cond; - if (IfPredicateInstr) { - assert(Instr->getParent()->getSinglePredecessor() && - "Only support single predecessor blocks"); - Cond = createEdgeMask(Instr->getParent()->getSinglePredecessor(), - Instr->getParent()); - } + if (IfPredicateInstr) + Cond = createBlockInMask(Instr->getParent()); // For each vector unroll 'part': for (unsigned Part = 0; Part < UF; ++Part) { |