]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
Use SDValue bool operator to reduce code. No functional change.
authorSanjay Patel <spatel@rotateright.com>
Tue, 23 Sep 2014 16:24:20 +0000 (16:24 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 23 Sep 2014 16:24:20 +0000 (16:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218314 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 30ac63570ff14362c8f771210b6c8979ad3e8264..33e70593d154d06996b59a32665bc458e3aaa625 100644 (file)
@@ -11712,27 +11712,24 @@ SDValue DAGCombiner::BuildRSQRTE(SDNode *N) {
   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);
     }
   }