projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b38b92
)
[X86] LowerToHorizontalOp - use count_if to count non-UNDEF ops. NFCI.
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 9 Jul 2019 19:19:17 +0000
(19:19 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 9 Jul 2019 19:19:17 +0000
(19:19 +0000)
llvm-svn: 365540
llvm/lib/Target/X86/X86ISelLowering.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Target/X86/X86ISelLowering.cpp
b/llvm/lib/Target/X86/X86ISelLowering.cpp
index
0e1b54e
..
370ecef
100644
(file)
--- a/
llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/
llvm/lib/Target/X86/X86ISelLowering.cpp
@@
-8759,11
+8759,8
@@
static SDValue LowerToHorizontalOp(const BuildVectorSDNode *BV,
const X86Subtarget &Subtarget,
SelectionDAG &DAG) {
// We need at least 2 non-undef elements to make this worthwhile by default.
- unsigned NumNonUndefs = 0;
- for (const SDValue &V : BV->op_values())
- if (!V.isUndef())
- ++NumNonUndefs;
-
+ unsigned NumNonUndefs =
+ count_if(BV->op_values(), [](SDValue V) { return !V.isUndef(); });
if (NumNonUndefs < 2)
return SDValue();