[llvm] r237705 - use range-based for loop
Sanjay Patel
spatel at rotateright.com
Tue May 19 10:49:14 PDT 2015
Author: spatel
Date: Tue May 19 12:49:14 2015
New Revision: 237705
URL: http://llvm.org/viewvc/llvm-project?rev=237705&view=rev
Log:
use range-based for loop
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=237705&r1=237704&r2=237705&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 19 12:49:14 2015
@@ -8294,11 +8294,11 @@ SDValue DAGCombiner::visitFDIV(SDNode *N
SDValue Reciprocal = DAG.getNode(ISD::FDIV, DL, VT, FPOne, N1);
// Dividend / Divisor -> Dividend * Reciprocal
- for (auto I = Users.begin(), E = Users.end(); I != E; ++I) {
- if ((*I)->getOperand(0) != FPOne) {
- SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(*I), VT,
- (*I)->getOperand(0), Reciprocal);
- DAG.ReplaceAllUsesWith(*I, NewNode.getNode());
+ for (auto &U : Users) {
+ if (U->getOperand(0) != FPOne) {
+ SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT,
+ U->getOperand(0), Reciprocal);
+ DAG.ReplaceAllUsesWith(U, NewNode.getNode());
}
}
return SDValue();
More information about the llvm-commits
mailing list