diff options
author | Cong Hou <congh@google.com> | 2016-02-26 23:25:30 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2016-02-26 23:25:30 +0000 |
commit | e0eb8bfe378f041e1b0068bcb32eb2cc2050dfd2 (patch) | |
tree | 885ac0cf5566a9755616c692a2c988e6a7d7adb7 /llvm/lib | |
parent | cc2e27f098b0515a7f4d2478c7bebe30169a49d6 (diff) | |
download | bcm5719-llvm-e0eb8bfe378f041e1b0068bcb32eb2cc2050dfd2.tar.gz bcm5719-llvm-e0eb8bfe378f041e1b0068bcb32eb2cc2050dfd2.zip |
Fix a bug in isVectorReductionOp() in SelectionDAGBuilder.cpp that may cause assertion failure on AArch64.
llvm-svn: 262091
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 8 |
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; |