diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-05-19 18:24:33 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-05-19 18:24:33 +0000 |
commit | 64a6da947ae42083a6e26a4fc5e01ea8f7190203 (patch) | |
tree | 0b234d5b948f49549fd5f201ae49a6cb49bcd328 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 4d5b7d4a04257c7e7f05d8f24984e4413b9f8b3f (diff) | |
download | bcm5719-llvm-64a6da947ae42083a6e26a4fc5e01ea8f7190203.tar.gz bcm5719-llvm-64a6da947ae42083a6e26a4fc5e01ea8f7190203.zip |
use range-based for-loop
llvm-svn: 237711
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8d5bd2b3389..20d78b87154 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8280,12 +8280,9 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) { SmallVector<SDNode *, 4> Users; // Find all FDIV users of the same divisor. - for (SDNode::use_iterator UI = N1.getNode()->use_begin(), - UE = N1.getNode()->use_end(); - UI != UE; ++UI) { - SDNode *User = UI.getUse().getUser(); - if (User->getOpcode() == ISD::FDIV && User->getOperand(1) == N1) - Users.push_back(User); + for (auto U : N1->uses()) { + if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1) + Users.push_back(U); } if (TLI.combineRepeatedFPDivisors(Users.size())) { @@ -8294,7 +8291,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) { SDValue Reciprocal = DAG.getNode(ISD::FDIV, DL, VT, FPOne, N1); // Dividend / Divisor -> Dividend * Reciprocal - for (auto &U : Users) { + for (auto U : Users) { if (U->getOperand(0) != FPOne) { SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT, U->getOperand(0), Reciprocal); |