[llvm] r218314 - Use SDValue bool operator to reduce code. No functional change.
Sanjay Patel
spatel at rotateright.com
Tue Sep 23 09:24:20 PDT 2014
Author: spatel
Date: Tue Sep 23 11:24:20 2014
New Revision: 218314
URL: http://llvm.org/viewvc/llvm-project?rev=218314&view=rev
Log:
Use SDValue bool operator to reduce code. No functional change.
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=218314&r1=218313&r2=218314&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Sep 23 11:24:20 2014
@@ -11712,27 +11712,24 @@ SDValue DAGCombiner::BuildRSQRTE(SDNode
SDValue N1 = N->getOperand(1);
if (N1.getOpcode() == ISD::FSQRT) {
- SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0), DCI);
- if (RV.getNode()) {
- DCI.AddToWorklist(RV.getNode());
+ if (SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0), DCI)) {
+ AddToWorklist(RV.getNode());
return DAG.getNode(ISD::FMUL, DL, VT, N->getOperand(0), RV);
}
} else if (N1.getOpcode() == ISD::FP_EXTEND &&
N1.getOperand(0).getOpcode() == ISD::FSQRT) {
- SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0).getOperand(0), DCI);
- if (RV.getNode()) {
+ if (SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0).getOperand(0), DCI)) {
DCI.AddToWorklist(RV.getNode());
RV = DAG.getNode(ISD::FP_EXTEND, SDLoc(N1), VT, RV);
- DCI.AddToWorklist(RV.getNode());
+ AddToWorklist(RV.getNode());
return DAG.getNode(ISD::FMUL, DL, VT, N->getOperand(0), RV);
}
} else if (N1.getOpcode() == ISD::FP_ROUND &&
N1.getOperand(0).getOpcode() == ISD::FSQRT) {
- SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0).getOperand(0), DCI);
- if (RV.getNode()) {
+ if (SDValue RV = TLI.BuildRSQRTE(N1.getOperand(0).getOperand(0), DCI)) {
DCI.AddToWorklist(RV.getNode());
RV = DAG.getNode(ISD::FP_ROUND, SDLoc(N1), VT, RV, N1.getOperand(1));
- DCI.AddToWorklist(RV.getNode());
+ AddToWorklist(RV.getNode());
return DAG.getNode(ISD::FMUL, DL, VT, N->getOperand(0), RV);
}
}
More information about the llvm-commits
mailing list