[llvm] r334436 - [X86] Push some variable declarations down into the individual switch cases that need them. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 13:50:58 PDT 2018


Author: ctopper
Date: Mon Jun 11 13:50:58 2018
New Revision: 334436

URL: http://llvm.org/viewvc/llvm-project?rev=334436&view=rev
Log:
[X86] Push some variable declarations down into the individual switch cases that need them. NFC

All of the cases are already wrapped in curly braces so declaring a variable there isn't an issue. And the variables aren't assigned or used in the larger scope.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=334436&r1=334435&r2=334436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Jun 11 13:50:58 2018
@@ -2708,7 +2708,6 @@ bool X86DAGToDAGISel::shrinkAndImmediate
 
 void X86DAGToDAGISel::Select(SDNode *Node) {
   MVT NVT = Node->getSimpleValueType(0);
-  unsigned Opc, MOpc;
   unsigned Opcode = Node->getOpcode();
   SDLoc dl(Node);
 
@@ -2853,7 +2852,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
     SDValue N0 = Node->getOperand(0);
     SDValue N1 = Node->getOperand(1);
 
-    Opc = (Opcode == X86ISD::SMUL8 ? X86::IMUL8r : X86::MUL8r);
+    unsigned Opc = (Opcode == X86ISD::SMUL8 ? X86::IMUL8r : X86::MUL8r);
 
     SDValue InFlag = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, X86::AL,
                                           N0, SDValue()).getValue(1);
@@ -2870,7 +2869,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
     SDValue N0 = Node->getOperand(0);
     SDValue N1 = Node->getOperand(1);
 
-    unsigned LoReg;
+    unsigned LoReg, Opc;
     switch (NVT.SimpleTy) {
     default: llvm_unreachable("Unsupported VT!");
     // MVT::i8 is handled by X86ISD::UMUL8.
@@ -2895,6 +2894,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
     SDValue N0 = Node->getOperand(0);
     SDValue N1 = Node->getOperand(1);
 
+    unsigned Opc, MOpc;
     bool isSigned = Opcode == ISD::SMUL_LOHI;
     bool hasBMI2 = Subtarget->hasBMI2();
     if (!isSigned) {
@@ -3021,6 +3021,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
     SDValue N0 = Node->getOperand(0);
     SDValue N1 = Node->getOperand(1);
 
+    unsigned Opc, MOpc;
     bool isSigned = (Opcode == ISD::SDIVREM ||
                      Opcode == X86ISD::SDIVREM8_SEXT_HREG);
     if (!isSigned) {




More information about the llvm-commits mailing list