Fix a typo.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 18 Sep 2006 23:28:33 +0000 (23:28 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 18 Sep 2006 23:28:33 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30474 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 70686d398a63ee3130c2726dea69e28a032023fb..aa25fd82956e3318195fb370fff0873316dc511e 100644 (file)
@@ -2331,14 +2331,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
       }
       break;
     case TargetLowering::Expand:
-      unsigned DivOpc= (Node->getOpcode() == ISD::UREM) ? ISD::UDIV : ISD::SREM;
+      unsigned DivOpc= (Node->getOpcode() == ISD::UREM) ? ISD::UDIV : ISD::SDIV;
       if (MVT::isInteger(Node->getValueType(0))) {
         if (TLI.getOperationAction(DivOpc, Node->getValueType(0)) ==
             TargetLowering::Legal) {
           // X % Y -> X-X/Y*Y
           MVT::ValueType VT = Node->getValueType(0);
-          unsigned Opc = Node->getOpcode() == ISD::UREM ? ISD::UDIV : ISD::SDIV;
-          Result = DAG.getNode(Opc, VT, Tmp1, Tmp2);
+          Result = DAG.getNode(DivOpc, VT, Tmp1, Tmp2);
           Result = DAG.getNode(ISD::MUL, VT, Result, Tmp2);
           Result = DAG.getNode(ISD::SUB, VT, Tmp1, Result);
         } else {