[llvm] r231569 - Use SDValue bool check to tidyup some possible combines. NFC.

Simon Pilgrim llvm-dev at redking.me.uk
Sat Mar 7 08:34:56 PST 2015


Author: rksimon
Date: Sat Mar  7 10:34:55 2015
New Revision: 231569

URL: http://llvm.org/viewvc/llvm-project?rev=231569&view=rev
Log:
Use SDValue bool check to tidyup some possible combines. NFC.

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=231569&r1=231568&r2=231569&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Mar  7 10:34:55 2015
@@ -11328,12 +11328,10 @@ SDValue DAGCombiner::visitBUILD_VECTOR(S
   if (ISD::allOperandsUndef(N))
     return DAG.getUNDEF(VT);
 
-  SDValue V = reduceBuildVecExtToExtBuildVec(N);
-  if (V.getNode())
+  if (SDValue V = reduceBuildVecExtToExtBuildVec(N))
     return V;
 
-  V = reduceBuildVecConvertToConvertBuildVec(N);
-  if (V.getNode())
+  if (SDValue V = reduceBuildVecConvertToConvertBuildVec(N))
     return V;
 
   // Check to see if this is a BUILD_VECTOR of a bunch of EXTRACT_VECTOR_ELT
@@ -12305,8 +12303,9 @@ SDValue DAGCombiner::SimplifyVBinOp(SDNo
 
   SDValue LHS = N->getOperand(0);
   SDValue RHS = N->getOperand(1);
-  SDValue Shuffle = XformToShuffleWithZero(N);
-  if (Shuffle.getNode()) return Shuffle;
+
+  if (SDValue Shuffle = XformToShuffleWithZero(N))
+    return Shuffle;
 
   // If the LHS and RHS are BUILD_VECTOR nodes, see if we can constant fold
   // this operation.





More information about the llvm-commits mailing list