diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 1317b53a78e..f3b81ba40fd 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -1212,8 +1212,9 @@ SDNode *X86DAGToDAGISel::SelectAtomic64(SDNode *Node, unsigned Opc) { return NULL; SDValue LSI = Node->getOperand(4); // MemOperand const SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, In2L, In2H, LSI, Chain }; - return CurDAG->getTargetNode(Opc, Node->getDebugLoc(), - MVT::i32, MVT::i32, MVT::Other, Ops, 8); + return CurDAG->getTargetNode(Opc, Node->getDebugLoc(), + MVT::i32, MVT::i32, MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)); } SDNode *X86DAGToDAGISel::Select(SDValue N) { @@ -1307,7 +1308,8 @@ SDNode *X86DAGToDAGISel::Select(SDValue N) { if (foldedLoad) { SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, 6); + CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, + sizeof(Ops)/sizeof(SDValue)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1426,7 +1428,8 @@ SDNode *X86DAGToDAGISel::Select(SDValue N) { SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N0.getOperand(0) }; Move = SDValue(CurDAG->getTargetNode(X86::MOVZX16rm8, dl, MVT::i16, - MVT::Other, Ops, 5), 0); + MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)), 0); Chain = Move.getValue(1); ReplaceUses(N0.getValue(1), Chain); } else { @@ -1456,7 +1459,8 @@ SDNode *X86DAGToDAGISel::Select(SDValue N) { if (foldedLoad) { SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, 6); + CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, + sizeof(Ops)/sizeof(SDValue)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1599,7 +1603,8 @@ SDNode *X86DAGToDAGISel::Select(SDValue N) { TLI.getPointerTy()); SDValue Ops[] = { Tmp1, Tmp2, Chain }; return CurDAG->getTargetNode(TargetInstrInfo::DECLARE, dl, - MVT::Other, Ops, 3); + MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)); } }