summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index ec25d7c5ecc..44e92b4ec08 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2393,8 +2393,9 @@ static bool isVectorReductionOp(const User *I) {
// ElemNumToReduce / 2 elements in another vector.
unsigned ResultElements = ShufInst->getType()->getVectorNumElements();
- ElemNumToReduce = ResultElements <= ElemNumToReduce ? ResultElements
- : ElemNumToReduce;
+ if (ResultElements < ElemNum)
+ return false;
+
if (ElemNumToReduce == 1)
return false;
if (!isa<UndefValue>(U->getOperand(1)))
@@ -2407,8 +2408,7 @@ static bool isVectorReductionOp(const User *I) {
return false;
// There is only one user of this ShuffleVector instruction, which
- // must
- // be a reduction operation.
+ // must be a reduction operation.
if (!U->hasOneUse())
return false;
OpenPOWER on IntegriCloud