diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
commit | 9fcebda97d0cb3d7a2235d2ad835c3a2679e7683 (patch) | |
tree | 461d3cf041290f4a99740d540bf0973d6084f98e /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | c5dd590220d0afe971d065bfe9324f549dd00968 (diff) | |
download | FreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.zip FreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.tar.gz |
Import llvm 3.7.0 release (r246257).
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 52d620b..3b29306 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8365,12 +8365,12 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) { if (N0CFP && N0CFP->isExactlyValue(1.0)) return SDValue(); - SmallVector<SDNode *, 4> Users; // Find all FDIV users of the same divisor. - for (auto *U : N1->uses()) { + // Use a set because duplicates may be present in the user list. + SetVector<SDNode *> Users; + for (auto *U : N1->uses()) if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1) - Users.push_back(U); - } + Users.insert(U); if (TLI.combineRepeatedFPDivisors(Users.size())) { SDValue FPOne = DAG.getConstantFP(1.0, DL, VT); |