Move one-use variable inside test. NFC.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 18 Oct 2015 11:47:23 +0000 (11:47 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 18 Oct 2015 11:47:23 +0000 (11:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250651 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 6d613436b8f377599e4d7d43a2ffb46ecbe1ef2a..74ecb1a87bceede45a30989b97bc968fb829f509 100644 (file)
@@ -3876,7 +3876,6 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1,
 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
                               SDValue N1, SDValue N2, SDValue N3) {
   // Perform various simplifications.
-  ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
   switch (Opcode) {
   case ISD::FMA: {
     ConstantFPSDNode *N1CFP = dyn_cast<ConstantFPSDNode>(N1);
@@ -3913,7 +3912,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
     break;
   }
   case ISD::SELECT:
-    if (N1C) {
+    if (ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1)) {
      if (N1C->getZExtValue())
        return N2;             // select true, X, Y -> X
      return N3;             // select false, X, Y -> Y