llvm.org GIT mirror llvm / f1b4eaf
rename MVT::Flag to MVT::Glue. "Flag" is a terrible name for something that just glues two nodes together, even if it is sometimes used for flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122310 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 8 years ago
38 changed file(s) with 153 addition(s) and 153 deletion(s). Raw diff Collapse all Expand all
401401 // null) and that there should be a flag result.
402402 SDValue getCopyToReg(SDValue Chain, DebugLoc dl, unsigned Reg, SDValue N,
403403 SDValue Flag) {
404 SDVTList VTs = getVTList(MVT::Other, MVT::Flag);
404 SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
405405 SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
406406 return getNode(ISD::CopyToReg, dl, VTs, Ops, Flag.getNode() ? 4 : 3);
407407 }
409409 // Similar to last getCopyToReg() except parameter Reg is a SDValue
410410 SDValue getCopyToReg(SDValue Chain, DebugLoc dl, SDValue Reg, SDValue N,
411411 SDValue Flag) {
412 SDVTList VTs = getVTList(MVT::Other, MVT::Flag);
412 SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
413413 SDValue Ops[] = { Chain, Reg, N, Flag };
414414 return getNode(ISD::CopyToReg, dl, VTs, Ops, Flag.getNode() ? 4 : 3);
415415 }
425425 // null) and that there should be a flag result.
426426 SDValue getCopyFromReg(SDValue Chain, DebugLoc dl, unsigned Reg, EVT VT,
427427 SDValue Flag) {
428 SDVTList VTs = getVTList(VT, MVT::Other, MVT::Flag);
428 SDVTList VTs = getVTList(VT, MVT::Other, MVT::Glue);
429429 SDValue Ops[] = { Chain, getRegister(Reg, VT), Flag };
430430 return getNode(ISD::CopyFromReg, dl, VTs, Ops, Flag.getNode() ? 3 : 2);
431431 }
464464 /// a flag result (to ensure it's not CSE'd). CALLSEQ_START does not have a
465465 /// useful DebugLoc.
466466 SDValue getCALLSEQ_START(SDValue Chain, SDValue Op) {
467 SDVTList VTs = getVTList(MVT::Other, MVT::Flag);
467 SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
468468 SDValue Ops[] = { Chain, Op };
469469 return getNode(ISD::CALLSEQ_START, DebugLoc(), VTs, Ops, 2);
470470 }
474474 /// a useful DebugLoc.
475475 SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2,
476476 SDValue InFlag) {
477 SDVTList NodeTys = getVTList(MVT::Other, MVT::Flag);
477 SDVTList NodeTys = getVTList(MVT::Other, MVT::Glue);
478478 SmallVector Ops;
479479 Ops.push_back(Chain);
480480 Ops.push_back(Op1);
527527 /// to which the flag operand points. Otherwise return NULL.
528528 SDNode *getFlaggedNode() const {
529529 if (getNumOperands() != 0 &&
530 getOperand(getNumOperands()-1).getValueType() == MVT::Flag)
530 getOperand(getNumOperands()-1).getValueType() == MVT::Glue)
531531 return getOperand(getNumOperands()-1).getNode();
532532 return 0;
533533 }
552552 /// the user (there is at most one). Otherwise return NULL.
553553 SDNode *getFlaggedUser() const {
554554 for (use_iterator UI = use_begin(), UE = use_end(); UI != UE; ++UI)
555 if (UI.getUse().get().getValueType() == MVT::Flag)
555 if (UI.getUse().get().getValueType() == MVT::Glue)
556556 return *UI;
557557 return 0;
558558 }
7878
7979 x86mmx = 33, // This is an X86 MMX value
8080
81 Flag = 34, // This glues nodes together during pre-RA sched
81 Glue = 34, // This glues nodes together during pre-RA sched
8282
8383 isVoid = 35, // This has no value
8484
14561456 if (N->hasNUsesOfValue(0, 1))
14571457 return CombineTo(N, DAG.getNode(ISD::ADD, N->getDebugLoc(), VT, N1, N0),
14581458 DAG.getNode(ISD::CARRY_FALSE,
1459 N->getDebugLoc(), MVT::Flag));
1459 N->getDebugLoc(), MVT::Glue));
14601460
14611461 // canonicalize constant to RHS.
14621462 if (N0C && !N1C)
14651465 // fold (addc x, 0) -> x + no carry out
14661466 if (N1C && N1C->isNullValue())
14671467 return CombineTo(N, N0, DAG.getNode(ISD::CARRY_FALSE,
1468 N->getDebugLoc(), MVT::Flag));
1468 N->getDebugLoc(), MVT::Glue));
14691469
14701470 // fold (addc a, b) -> (or a, b), CARRY_FALSE iff a and b share no bits.
14711471 APInt LHSZero, LHSOne;
14821482 (LHSZero & (~RHSZero & Mask)) == (~RHSZero & Mask))
14831483 return CombineTo(N, DAG.getNode(ISD::OR, N->getDebugLoc(), VT, N0, N1),
14841484 DAG.getNode(ISD::CARRY_FALSE,
1485 N->getDebugLoc(), MVT::Flag));
1485 N->getDebugLoc(), MVT::Glue));
14861486 }
14871487
14881488 return SDValue();
3434 /// not go into the resulting MachineInstr).
3535 unsigned InstrEmitter::CountResults(SDNode *Node) {
3636 unsigned N = Node->getNumValues();
37 while (N && Node->getValueType(N - 1) == MVT::Flag)
37 while (N && Node->getValueType(N - 1) == MVT::Glue)
3838 --N;
3939 if (N && Node->getValueType(N - 1) == MVT::Other)
4040 --N; // Skip over chain result.
4747 /// MachineInstr.
4848 unsigned InstrEmitter::CountOperands(SDNode *Node) {
4949 unsigned N = Node->getNumOperands();
50 while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
50 while (N && Node->getOperand(N - 1).getValueType() == MVT::Glue)
5151 --N;
5252 if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
5353 --N; // Ignore chain if it exists.
9595 if (Op.getNode() != Node || Op.getResNo() != ResNo)
9696 continue;
9797 EVT VT = Node->getValueType(Op.getResNo());
98 if (VT == MVT::Other || VT == MVT::Flag)
98 if (VT == MVT::Other || VT == MVT::Glue)
9999 continue;
100100 Match = false;
101101 if (User->isMachineOpcode()) {
263263 DenseMap &VRBaseMap,
264264 bool IsDebug, bool IsClone, bool IsCloned) {
265265 assert(Op.getValueType() != MVT::Other &&
266 Op.getValueType() != MVT::Flag &&
266 Op.getValueType() != MVT::Glue &&
267267 "Chain and flag operands should occur at end of operand list!");
268268 // Get/emit the operand.
269269 unsigned VReg = getVR(Op, VRBaseMap);
376376 BA->getTargetFlags()));
377377 } else {
378378 assert(Op.getValueType() != MVT::Other &&
379 Op.getValueType() != MVT::Flag &&
379 Op.getValueType() != MVT::Glue &&
380380 "Chain and flag operands should occur at end of operand list!");
381381 AddRegisterOperand(MI, Op, IIOpNum, II, VRBaseMap,
382382 IsDebug, IsClone, IsCloned);
670670 // The MachineInstr constructor adds implicit-def operands. Scan through
671671 // these to determine which are dead.
672672 if (MI->getNumOperands() != 0 &&
673 Node->getValueType(Node->getNumValues()-1) == MVT::Flag) {
673 Node->getValueType(Node->getNumValues()-1) == MVT::Glue) {
674674 // First, collect all used registers.
675675 SmallVector UsedRegs;
676676 for (SDNode *F = Node->getFlaggedUser(); F; F = F->getFlaggedUser())
728728 // MachineLICM/Sink can see that it's dead. Don't do this if the
729729 // node has a Flag value, for the benefit of targets still using
730730 // Flag for values in physregs.
731 else if (Node->getValueType(Node->getNumValues()-1) != MVT::Flag)
731 else if (Node->getValueType(Node->getNumValues()-1) != MVT::Glue)
732732 MI->addRegisterDead(Reg, TRI);
733733 }
734734 }
736736 // If the instruction has implicit defs and the node doesn't, mark the
737737 // implicit def as dead. If the node has any flag outputs, we don't do this
738738 // because we don't know what implicit defs are being used by flagged nodes.
739 if (Node->getValueType(Node->getNumValues()-1) != MVT::Flag)
739 if (Node->getValueType(Node->getNumValues()-1) != MVT::Glue)
740740 if (const unsigned *IDList = II.getImplicitDefs()) {
741741 for (unsigned i = NumResults, e = II.getNumDefs()+II.getNumImplicitDefs();
742742 i != e; ++i)
792792
793793 case ISD::INLINEASM: {
794794 unsigned NumOps = Node->getNumOperands();
795 if (Node->getOperand(NumOps-1).getValueType() == MVT::Flag)
795 if (Node->getOperand(NumOps-1).getValueType() == MVT::Glue)
796796 --NumOps; // Ignore the flag operand.
797797
798798 // Create the inline asm machine instruction.
10841084 Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
10851085 // Do not try to legalize the target-specific arguments (#1+), except for
10861086 // an optional flag input.
1087 if (Node->getOperand(Node->getNumOperands()-1).getValueType() != MVT::Flag){
1087 if (Node->getOperand(Node->getNumOperands()-1).getValueType() != MVT::Glue){
10881088 if (Tmp1 != Node->getOperand(0)) {
10891089 SmallVector Ops(Node->op_begin(), Node->op_end());
10901090 Ops[0] = Tmp1;
10741074 TLI.isOperationLegalOrCustom(ISD::ADDC,
10751075 TLI.getTypeToExpandTo(*DAG.getContext(), NVT))) {
10761076 // Emit this X << 1 as X+X.
1077 SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);
1077 SDVTList VTList = DAG.getVTList(NVT, MVT::Glue);
10781078 SDValue LoOps[2] = { InL, InL };
10791079 Lo = DAG.getNode(ISD::ADDC, dl, VTList, LoOps, 2);
10801080 SDValue HiOps[3] = { InH, InH, Lo.getValue(1) };
13091309 // Do not generate ADDC/ADDE or SUBC/SUBE if the target does not support
13101310 // them. TODO: Teach operation legalization how to expand unsupported
13111311 // ADDC/ADDE/SUBC/SUBE. The problem is that these operations generate
1312 // a carry of type MVT::Flag, but there doesn't seem to be any way to
1312 // a carry of type MVT::Glue, but there doesn't seem to be any way to
13131313 // generate a value of this type in the expanded code sequence.
13141314 bool hasCarry =
13151315 TLI.isOperationLegalOrCustom(N->getOpcode() == ISD::ADD ?
13171317 TLI.getTypeToExpandTo(*DAG.getContext(), NVT));
13181318
13191319 if (hasCarry) {
1320 SDVTList VTList = DAG.getVTList(NVT, MVT::Flag);
1320 SDVTList VTList = DAG.getVTList(NVT, MVT::Glue);
13211321 if (N->getOpcode() == ISD::ADD) {
13221322 Lo = DAG.getNode(ISD::ADDC, dl, VTList, LoOps, 2);
13231323 HiOps[2] = Lo.getValue(1);
13631363 DebugLoc dl = N->getDebugLoc();
13641364 GetExpandedInteger(N->getOperand(0), LHSL, LHSH);
13651365 GetExpandedInteger(N->getOperand(1), RHSL, RHSH);
1366 SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
1366 SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Glue);
13671367 SDValue LoOps[2] = { LHSL, RHSL };
13681368 SDValue HiOps[3] = { LHSH, RHSH };
13691369
13891389 DebugLoc dl = N->getDebugLoc();
13901390 GetExpandedInteger(N->getOperand(0), LHSL, LHSH);
13911391 GetExpandedInteger(N->getOperand(1), RHSL, RHSH);
1392 SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag);
1392 SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Glue);
13931393 SDValue LoOps[3] = { LHSL, RHSL, N->getOperand(2) };
13941394 SDValue HiOps[3] = { LHSH, RHSH };
13951395
215215 bool TryUnfold = false;
216216 for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
217217 EVT VT = N->getValueType(i);
218 if (VT == MVT::Flag)
218 if (VT == MVT::Glue)
219219 return NULL;
220220 else if (VT == MVT::Other)
221221 TryUnfold = true;
223223 for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
224224 const SDValue &Op = N->getOperand(i);
225225 EVT VT = Op.getNode()->getValueType(Op.getResNo());
226 if (VT == MVT::Flag)
226 if (VT == MVT::Glue)
227227 return NULL;
228228 }
229229
479479 if (Node->getOpcode() == ISD::INLINEASM) {
480480 // Inline asm can clobber physical defs.
481481 unsigned NumOps = Node->getNumOperands();
482 if (Node->getOperand(NumOps-1).getValueType() == MVT::Flag)
482 if (Node->getOperand(NumOps-1).getValueType() == MVT::Glue)
483483 --NumOps; // Ignore the flag operand.
484484
485485 for (unsigned i = InlineAsm::Op_FirstOperand; i != NumOps;) {
400400 bool TryUnfold = false;
401401 for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
402402 EVT VT = N->getValueType(i);
403 if (VT == MVT::Flag)
403 if (VT == MVT::Glue)
404404 return NULL;
405405 else if (VT == MVT::Other)
406406 TryUnfold = true;
408408 for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
409409 const SDValue &Op = N->getOperand(i);
410410 EVT VT = Op.getNode()->getValueType(Op.getResNo());
411 if (VT == MVT::Flag)
411 if (VT == MVT::Glue)
412412 return NULL;
413413 }
414414
670670 if (Node->getOpcode() == ISD::INLINEASM) {
671671 // Inline asm can clobber physical defs.
672672 unsigned NumOps = Node->getNumOperands();
673 if (Node->getOperand(NumOps-1).getValueType() == MVT::Flag)
673 if (Node->getOperand(NumOps-1).getValueType() == MVT::Glue)
674674 --NumOps; // Ignore the flag operand.
675675
676676 for (unsigned i = InlineAsm::Op_FirstOperand; i != NumOps;) {
14091409 unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs();
14101410 for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) {
14111411 EVT VT = N->getValueType(i);
1412 if (VT == MVT::Flag || VT == MVT::Other)
1412 if (VT == MVT::Glue || VT == MVT::Other)
14131413 continue;
14141414 if (!N->hasAnyUseOfValue(i))
14151415 continue;
17231723 return false;
17241724 for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) {
17251725 EVT VT = N->getValueType(i);
1726 if (VT == MVT::Flag || VT == MVT::Other)
1726 if (VT == MVT::Glue || VT == MVT::Other)
17271727 continue;
17281728 if (!N->hasAnyUseOfValue(i))
17291729 continue;
117117 if (FlagDestNode == N) return;
118118
119119 // Don't add a flag to something which already has a flag.
120 if (N->getValueType(N->getNumValues() - 1) == MVT::Flag) return;
120 if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return;
121121
122122 for (unsigned I = 0, E = N->getNumValues(); I != E; ++I)
123123 VTs.push_back(N->getValueType(I));
124124
125125 if (AddFlag)
126 VTs.push_back(MVT::Flag);
126 VTs.push_back(MVT::Glue);
127127
128128 SmallVector Ops;
129129 for (unsigned I = 0, E = N->getNumOperands(); I != E; ++I)
151151
152152 /// ClusterNeighboringLoads - Force nearby loads together by "flagging" them.
153153 /// This function finds loads of the same base and different offsets. If the
154 /// offsets are not far apart (target specific), it add MVT::Flag inputs and
154 /// offsets are not far apart (target specific), it add MVT::Glue inputs and
155155 /// outputs to ensure they are scheduled together and in order. This
156156 /// optimization may benefit some targets by improving cache locality.
157157 void ScheduleDAGSDNodes::ClusterNeighboringLoads(SDNode *Node) {
213213 if (NumLoads == 0)
214214 return;
215215
216 // Cluster loads by adding MVT::Flag outputs and inputs. This also
216 // Cluster loads by adding MVT::Glue outputs and inputs. This also
217217 // ensure they are scheduled in order of increasing addresses.
218218 SDNode *Lead = Loads[0];
219219 AddFlags(Lead, SDValue(0, 0), true, DAG);
296296 // Scan up to find flagged preds.
297297 SDNode *N = NI;
298298 while (N->getNumOperands() &&
299 N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) {
299 N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue) {
300300 N = N->getOperand(N->getNumOperands()-1).getNode();
301301 assert(N->getNodeId() == -1 && "Node already inserted!");
302302 N->setNodeId(NodeSUnit->NodeNum);
306306
307307 // Scan down to find any flagged succs.
308308 N = NI;
309 while (N->getValueType(N->getNumValues()-1) == MVT::Flag) {
309 while (N->getValueType(N->getNumValues()-1) == MVT::Glue) {
310310 SDValue FlagVal(N, N->getNumValues()-1);
311311
312312 // There are either zero or one users of the Flag result.
381381 if (OpSU == SU) continue; // In the same group.
382382
383383 EVT OpVT = N->getOperand(i).getValueType();
384 assert(OpVT != MVT::Flag && "Flagged nodes should be in same sunit!");
384 assert(OpVT != MVT::Glue && "Flagged nodes should be in same sunit!");
385385 bool isChain = OpVT == MVT::Other;
386386
387387 unsigned PhysReg = 0;
2525 /// SDNodes such as Constants, Registers, and a few others that are not
2626 /// interesting to schedulers are not allocated SUnits.
2727 ///
28 /// SDNodes with MVT::Flag operands are grouped along with the flagged
28 /// SDNodes with MVT::Glue operands are grouped along with the flagged
2929 /// nodes into a single SUnit so that they are scheduled together.
3030 ///
3131 /// SDNode-based scheduling graphs do not use SDep::Anti or SDep::Output
490490
491491 /// doNotCSE - Return true if CSE should not be performed for this node.
492492 static bool doNotCSE(SDNode *N) {
493 if (N->getValueType(0) == MVT::Flag)
493 if (N->getValueType(0) == MVT::Glue)
494494 return true; // Never CSE anything that produces a flag.
495495
496496 switch (N->getOpcode()) {
502502
503503 // Check that remaining values produced are not flags.
504504 for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
505 if (N->getValueType(i) == MVT::Flag)
505 if (N->getValueType(i) == MVT::Glue)
506506 return true; // Never CSE anything that produces a flag.
507507
508508 return false;
648648 // Verify that the node was actually in one of the CSE maps, unless it has a
649649 // flag result (which cannot be CSE'd) or is one of the special cases that are
650650 // not subject to CSE.
651 if (!Erased && N->getValueType(N->getNumValues()-1) != MVT::Flag &&
651 if (!Erased && N->getValueType(N->getNumValues()-1) != MVT::Glue &&
652652 !N->isMachineOpcode() && !doNotCSE(N)) {
653653 N->dump(this);
654654 dbgs() << "\n";
25632563
25642564 SDNode *N;
25652565 SDVTList VTs = getVTList(VT);
2566 if (VT != MVT::Flag) { // Don't CSE flag producing nodes
2566 if (VT != MVT::Glue) { // Don't CSE flag producing nodes
25672567 FoldingSetNodeID ID;
25682568 SDValue Ops[1] = { Operand };
25692569 AddNodeIDNode(ID, Opcode, VTs, Ops, 1);
30053005 // Memoize this node if possible.
30063006 SDNode *N;
30073007 SDVTList VTs = getVTList(VT);
3008 if (VT != MVT::Flag) {
3008 if (VT != MVT::Glue) {
30093009 SDValue Ops[] = { N1, N2 };
30103010 FoldingSetNodeID ID;
30113011 AddNodeIDNode(ID, Opcode, VTs, Ops, 2);
30733073 // Memoize node if it doesn't produce a flag.
30743074 SDNode *N;
30753075 SDVTList VTs = getVTList(VT);
3076 if (VT != MVT::Flag) {
3076 if (VT != MVT::Glue) {
30773077 SDValue Ops[] = { N1, N2, N3 };
30783078 FoldingSetNodeID ID;
30793079 AddNodeIDNode(ID, Opcode, VTs, Ops, 3);
38813881
38823882 // Memoize the node unless it returns a flag.
38833883 MemIntrinsicSDNode *N;
3884 if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) {
3884 if (VTList.VTs[VTList.NumVTs-1] != MVT::Glue) {
38853885 FoldingSetNodeID ID;
38863886 AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps);
38873887 void *IP = 0;
42374237 SDNode *N;
42384238 SDVTList VTs = getVTList(VT);
42394239
4240 if (VT != MVT::Flag) {
4240 if (VT != MVT::Glue) {
42414241 FoldingSetNodeID ID;
42424242 AddNodeIDNode(ID, Opcode, VTs, Ops, NumOps);
42434243 void *IP = 0;
43034303
43044304 // Memoize the node unless it returns a flag.
43054305 SDNode *N;
4306 if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) {
4306 if (VTList.VTs[VTList.NumVTs-1] != MVT::Glue) {
43074307 FoldingSetNodeID ID;
43084308 AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps);
43094309 void *IP = 0;
47124712 unsigned NumOps) {
47134713 // If an identical node already exists, use it.
47144714 void *IP = 0;
4715 if (VTs.VTs[VTs.NumVTs-1] != MVT::Flag) {
4715 if (VTs.VTs[VTs.NumVTs-1] != MVT::Glue) {
47164716 FoldingSetNodeID ID;
47174717 AddNodeIDNode(ID, Opc, VTs, Ops, NumOps);
47184718 if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP))
49124912 MachineSDNode *
49134913 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc DL, SDVTList VTs,
49144914 const SDValue *Ops, unsigned NumOps) {
4915 bool DoCSE = VTs.VTs[VTs.NumVTs-1] != MVT::Flag;
4915 bool DoCSE = VTs.VTs[VTs.NumVTs-1] != MVT::Glue;
49164916 MachineSDNode *N;
49174917 void *IP;
49184918
49744974 /// else return NULL.
49754975 SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList,
49764976 const SDValue *Ops, unsigned NumOps) {
4977 if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) {
4977 if (VTList.VTs[VTList.NumVTs-1] != MVT::Glue) {
49784978 FoldingSetNodeID ID;
49794979 AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps);
49804980 void *IP = 0;
59215921 if (Flag.getNode()) AsmNodeOperands.push_back(Flag);
59225922
59235923 Chain = DAG.getNode(ISD::INLINEASM, getCurDebugLoc(),
5924 DAG.getVTList(MVT::Other, MVT::Flag),
5924 DAG.getVTList(MVT::Other, MVT::Glue),
59255925 &AsmNodeOperands[0], AsmNodeOperands.size());
59265926 Flag = Chain.getValue(1);
59275927
12861286 Ops.push_back(InOps[InlineAsm::Op_IsAlignStack]); // 3
12871287
12881288 unsigned i = InlineAsm::Op_FirstOperand, e = InOps.size();
1289 if (InOps[e-1].getValueType() == MVT::Flag)
1289 if (InOps[e-1].getValueType() == MVT::Glue)
12901290 --e; // Don't process a flag operand if it is here.
12911291
12921292 while (i != e) {
14341434 // If the node has flags, walk down the graph to the "lowest" node in the
14351435 // flagged set.
14361436 EVT VT = Root->getValueType(Root->getNumValues()-1);
1437 while (VT == MVT::Flag) {
1437 while (VT == MVT::Glue) {
14381438 SDNode *FU = findFlagUse(Root);
14391439 if (FU == NULL)
14401440 break;
14591459
14601460 std::vector VTs;
14611461 VTs.push_back(MVT::Other);
1462 VTs.push_back(MVT::Flag);
1462 VTs.push_back(MVT::Glue);
14631463 SDValue New = CurDAG->getNode(ISD::INLINEASM, N->getDebugLoc(),
14641464 VTs, &Ops[0], Ops.size());
14651465 New->setNodeId(-1);
15201520 continue;
15211521
15221522 SDValue ChainVal = SDValue(ChainNode, ChainNode->getNumValues()-1);
1523 if (ChainVal.getValueType() == MVT::Flag)
1523 if (ChainVal.getValueType() == MVT::Glue)
15241524 ChainVal = ChainVal.getValue(ChainVal->getNumValues()-2);
15251525 assert(ChainVal.getValueType() == MVT::Other && "Not a chain?");
15261526 CurDAG->ReplaceAllUsesOfValueWith(ChainVal, InputChain, &ISU);
15431543 if (FRN->getOpcode() == ISD::DELETED_NODE)
15441544 continue;
15451545
1546 assert(FRN->getValueType(FRN->getNumValues()-1) == MVT::Flag &&
1546 assert(FRN->getValueType(FRN->getNumValues()-1) == MVT::Glue &&
15471547 "Doesn't have a flag result");
15481548 CurDAG->ReplaceAllUsesOfValueWith(SDValue(FRN, FRN->getNumValues()-1),
15491549 InputFlag, &ISU);
17511751 int OldFlagResultNo = -1, OldChainResultNo = -1;
17521752
17531753 unsigned NTMNumResults = Node->getNumValues();
1754 if (Node->getValueType(NTMNumResults-1) == MVT::Flag) {
1754 if (Node->getValueType(NTMNumResults-1) == MVT::Glue) {
17551755 OldFlagResultNo = NTMNumResults-1;
17561756 if (NTMNumResults != 1 &&
17571757 Node->getValueType(NTMNumResults-2) == MVT::Other)
21922192 case OPC_CaptureFlagInput:
21932193 // If the current node has an input flag, capture it in InputFlag.
21942194 if (N->getNumOperands() != 0 &&
2195 N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag)
2195 N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue)
21962196 InputFlag = N->getOperand(N->getNumOperands()-1);
21972197 continue;
21982198
25022502 if (EmitNodeInfo & OPFL_Chain)
25032503 VTs.push_back(MVT::Other);
25042504 if (EmitNodeInfo & OPFL_FlagOutput)
2505 VTs.push_back(MVT::Flag);
2505 VTs.push_back(MVT::Glue);
25062506
25072507 // This is hot code, so optimize the two most common cases of 1 and 2
25082508 // results.
25382538 for (unsigned i = FirstOpToCopy, e = NodeToMatch->getNumOperands();
25392539 i != e; ++i) {
25402540 SDValue V = NodeToMatch->getOperand(i);
2541 if (V.getValueType() == MVT::Flag) break;
2541 if (V.getValueType() == MVT::Glue) break;
25422542 Ops.push_back(V);
25432543 }
25442544 }
25592559
25602560 // Add all the non-flag/non-chain results to the RecordedNodes list.
25612561 for (unsigned i = 0, e = VTs.size(); i != e; ++i) {
2562 if (VTs[i] == MVT::Other || VTs[i] == MVT::Flag) break;
2562 if (VTs[i] == MVT::Other || VTs[i] == MVT::Glue) break;
25632563 RecordedNodes.push_back(std::pair(SDValue(Res, i),
25642564 (SDNode*) 0));
25652565 }
26382638
26392639 assert(i < NodeToMatch->getNumValues() &&
26402640 NodeToMatch->getValueType(i) != MVT::Other &&
2641 NodeToMatch->getValueType(i) != MVT::Flag &&
2641 NodeToMatch->getValueType(i) != MVT::Glue &&
26422642 "Invalid number of results to complete!");
26432643 assert((NodeToMatch->getValueType(i) == Res.getValueType() ||
26442644 NodeToMatch->getValueType(i) == MVT::iPTR ||
26512651
26522652 // If the root node defines a flag, add it to the flag nodes to update
26532653 // list.
2654 if (NodeToMatch->getValueType(NodeToMatch->getNumValues()-1) == MVT::Flag)
2654 if (NodeToMatch->getValueType(NodeToMatch->getNumValues()-1) == MVT::Glue)
26552655 FlagResultNodesMatched.push_back(NodeToMatch);
26562656
26572657 // Update chain and flag uses.
9292 static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
9393 SDValue Op = EI.getNode()->getOperand(EI.getOperand());
9494 EVT VT = Op.getValueType();
95 if (VT == MVT::Flag)
95 if (VT == MVT::Glue)
9696 return "color=red,style=bold";
9797 else if (VT == MVT::Other)
9898 return "color=blue,style=dashed";
23782378 MVT::i32);
23792379 SDValue Ops[] = { N1, Tmp2, N3, Chain, InFlag };
23802380 SDNode *ResNode = CurDAG->getMachineNode(Opc, dl, MVT::Other,
2381 MVT::Flag, Ops, 5);
2381 MVT::Glue, Ops, 5);
23822382 Chain = SDValue(ResNode, 0);
23832383 if (N->getNumValues() == 2) {
23842384 InFlag = SDValue(ResNode, 1);
873873
874874 for (unsigned i = 0; i != NumVals; ++i) {
875875 EVT VT = N->getValueType(i);
876 if (VT == MVT::Flag || VT == MVT::Other)
876 if (VT == MVT::Glue || VT == MVT::Other)
877877 continue;
878878 if (VT.isFloatingPoint() || VT.isVector())
879879 return Sched::Latency;
14221422 if (InFlag.getNode())
14231423 Ops.push_back(InFlag);
14241424
1425 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
1425 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
14261426 if (isTailCall)
14271427 return DAG.getNode(ARMISD::TC_RETURN, dl, NodeTys, &Ops[0], Ops.size());
14281428
24292429 break;
24302430 }
24312431 ARMcc = DAG.getConstant(CondCode, MVT::i32);
2432 return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS);
2432 return DAG.getNode(CompareType, dl, MVT::Glue, LHS, RHS);
24332433 }
24342434
24352435 /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands.
24382438 DebugLoc dl) const {
24392439 SDValue Cmp;
24402440 if (!isFloatingPointZero(RHS))
2441 Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS);
2441 Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Glue, LHS, RHS);
24422442 else
2443 Cmp = DAG.getNode(ARMISD::CMPFPw0, dl, MVT::Flag, LHS);
2444 return DAG.getNode(ARMISD::FMSTAT, dl, MVT::Flag, Cmp);
2443 Cmp = DAG.getNode(ARMISD::CMPFPw0, dl, MVT::Glue, LHS);
2444 return DAG.getNode(ARMISD::FMSTAT, dl, MVT::Glue, Cmp);
24452445 }
24462446
24472447 SDValue ARMTargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
26322632 expandf64Toi32(RHS, DAG, RHS1, RHS2);
26332633 ARMCC::CondCodes CondCode = IntCCToARMCC(CC);
26342634 ARMcc = DAG.getConstant(CondCode, MVT::i32);
2635 SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag);
2635 SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Glue);
26362636 SDValue Ops[] = { Chain, ARMcc, LHS1, LHS2, RHS1, RHS2, Dest };
26372637 return DAG.getNode(ARMISD::BCC_i64, dl, VTList, Ops, 7);
26382638 }
26722672 SDValue ARMcc = DAG.getConstant(CondCode, MVT::i32);
26732673 SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl);
26742674 SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32);
2675 SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag);
2675 SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Glue);
26762676 SDValue Ops[] = { Chain, Dest, ARMcc, CCR, Cmp };
26772677 SDValue Res = DAG.getNode(ARMISD::BRCOND, dl, VTList, Ops, 5);
26782678 if (CondCode2 != ARMCC::AL) {
30283028 // First, build a SRA_FLAG/SRL_FLAG op, which shifts the top part by one and
30293029 // captures the result into a carry flag.
30303030 unsigned Opc = N->getOpcode() == ISD::SRL ? ARMISD::SRL_FLAG:ARMISD::SRA_FLAG;
3031 Hi = DAG.getNode(Opc, dl, DAG.getVTList(MVT::i32, MVT::Flag), &Hi, 1);
3031 Hi = DAG.getNode(Opc, dl, DAG.getVTList(MVT::i32, MVT::Glue), &Hi, 1);
30323032
30333033 // The low part is an ARMISD::RRX operand, which shifts the carry in.
30343034 Lo = DAG.getNode(ARMISD::RRX, dl, MVT::i32, Lo, Hi.getValue(1));
239239 Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R27, N0,
240240 Chain.getValue(1));
241241 SDNode *CNode =
242 CurDAG->getMachineNode(Alpha::JSRs, dl, MVT::Other, MVT::Flag,
242 CurDAG->getMachineNode(Alpha::JSRs, dl, MVT::Other, MVT::Glue,
243243 Chain, Chain.getValue(1));
244244 Chain = CurDAG->getCopyFromReg(Chain, dl, Alpha::R27, MVT::i64,
245245 SDValue(CNode, 1));
402402 Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R29, GOT, InFlag);
403403 InFlag = Chain.getValue(1);
404404 Chain = SDValue(CurDAG->getMachineNode(Alpha::BSR, dl, MVT::Other,
405 MVT::Flag, Addr.getOperand(0),
405 MVT::Glue, Addr.getOperand(0),
406406 Chain, InFlag), 0);
407407 } else {
408408 Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R27, Addr, InFlag);
409409 InFlag = Chain.getValue(1);
410410 Chain = SDValue(CurDAG->getMachineNode(Alpha::JSR, dl, MVT::Other,
411 MVT::Flag, Chain, InFlag), 0);
411 MVT::Glue, Chain, InFlag), 0);
412412 }
413413 InFlag = Chain.getValue(1);
414414
305305 }
306306
307307 // Returns a chain & a flag for retval copy to use.
308 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
308 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
309309 SmallVector Ops;
310310 Ops.push_back(Chain);
311311 Ops.push_back(Callee);
364364
365365 std::vector NodeTys;
366366 NodeTys.push_back(MVT::Other); // Returns a chain
367 NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
367 NodeTys.push_back(MVT::Glue); // Returns a flag for retval copy to use.
368368 SDValue Ops[] = { Chain, Callee, InFlag };
369369 Chain = DAG.getNode(BFISD::CALL, dl, NodeTys, Ops,
370370 InFlag.getNode() ? 3 : 2);
431431 SDValue(CarryIn, 0));
432432
433433 // Add operands, produce sum and carry flag
434 SDNode *Sum = DAG.getMachineNode(Opcode, dl, MVT::i32, MVT::Flag,
434 SDNode *Sum = DAG.getMachineNode(Opcode, dl, MVT::i32, MVT::Glue,
435435 Op.getOperand(0), Op.getOperand(1));
436436
437437 // Store intermediate carry from Sum
439439 /* flag= */ SDValue(Sum, 1));
440440
441441 // Add incoming carry, again producing an output flag
442 Sum = DAG.getMachineNode(Opcode, dl, MVT::i32, MVT::Flag,
442 Sum = DAG.getMachineNode(Opcode, dl, MVT::i32, MVT::Glue,
443443 SDValue(Sum, 0), SDValue(CarryIn, 0));
444444
445445 // Update AC0 with the intermediate carry, producing a flag.
446 SDNode *CarryOut = DAG.getMachineNode(BF::OR_ac0_cc, dl, MVT::Flag,
446 SDNode *CarryOut = DAG.getMachineNode(BF::OR_ac0_cc, dl, MVT::Glue,
447447 SDValue(Carry1, 0));
448448
449449 // Compose (i32, flag) pair
14221422 if (InFlag.getNode())
14231423 Ops.push_back(InFlag);
14241424 // Returns a chain and a flag for retval copy to use.
1425 Chain = DAG.getNode(CallOpc, dl, DAG.getVTList(MVT::Other, MVT::Flag),
1425 Chain = DAG.getNode(CallOpc, dl, DAG.getVTList(MVT::Other, MVT::Glue),
14261426 &Ops[0], Ops.size());
14271427 InFlag = Chain.getValue(1);
14281428
247247
248248 // Emit Jump and Link Register
249249 SDNode *ResNode = CurDAG->getMachineNode(MBlaze::BRLID, dl, MVT::Other,
250 MVT::Flag, R20Reg, Chain);
250 MVT::Glue, R20Reg, Chain);
251251 Chain = SDValue(ResNode, 0);
252252 InFlag = SDValue(ResNode, 1);
253253 ReplaceUses(SDValue(Node, 0), Chain);
620620 // = Chain, Callee, Reg#1, Reg#2, ...
621621 //
622622 // Returns a chain & a flag for retval copy to use.
623 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
623 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
624624 SmallVector Ops;
625625 Ops.push_back(Chain);
626626 Ops.push_back(Callee);
535535 Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i16);
536536
537537 // Returns a chain & a flag for retval copy to use.
538 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
538 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
539539 SmallVector Ops;
540540 Ops.push_back(Chain);
541541 Ops.push_back(Callee);
746746 }
747747
748748 TargetCC = DAG.getConstant(TCC, MVT::i8);
749 return DAG.getNode(MSP430ISD::CMP, dl, MVT::Flag, LHS, RHS);
749 return DAG.getNode(MSP430ISD::CMP, dl, MVT::Glue, LHS, RHS);
750750 }
751751
752752
835835 return SR;
836836 } else {
837837 SDValue Zero = DAG.getConstant(0, VT);
838 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Flag);
838 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Glue);
839839 SmallVector Ops;
840840 Ops.push_back(One);
841841 Ops.push_back(Zero);
857857 SDValue TargetCC;
858858 SDValue Flag = EmitCMP(LHS, RHS, TargetCC, CC, dl, DAG);
859859
860 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Flag);
860 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Glue);
861861 SmallVector Ops;
862862 Ops.push_back(TrueV);
863863 Ops.push_back(FalseV);
348348 SDNode *AddCarry = CurDAG->getMachineNode(Mips::ADDu, dl, VT,
349349 SDValue(Carry,0), RHS);
350350
351 return CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Flag,
351 return CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue,
352352 LHS, SDValue(AddCarry,0));
353353 }
354354
366366 else
367367 Op = (Opcode == ISD::UDIVREM ? Mips::DIVu : Mips::DIV);
368368
369 SDNode *MulDiv = CurDAG->getMachineNode(Op, dl, MVT::Flag, Op1, Op2);
369 SDNode *MulDiv = CurDAG->getMachineNode(Op, dl, MVT::Glue, Op1, Op2);
370370
371371 SDValue InFlag = SDValue(MulDiv, 0);
372372 SDNode *Lo = CurDAG->getMachineNode(Mips::MFLO, dl, MVT::i32,
373 MVT::Flag, InFlag);
373 MVT::Glue, InFlag);
374374 InFlag = SDValue(Lo,1);
375375 SDNode *Hi = CurDAG->getMachineNode(Mips::MFHI, dl, MVT::i32, InFlag);
376376
394394
395395 unsigned MulOp = (Opcode == ISD::MULHU ? Mips::MULTu : Mips::MULT);
396396 SDNode *MulNode = CurDAG->getMachineNode(MulOp, dl,
397 MVT::Flag, MulOp1, MulOp2);
397 MVT::Glue, MulOp1, MulOp2);
398398
399399 SDValue InFlag = SDValue(MulNode, 0);
400400
420420 Op = (Opcode == ISD::SREM ? Mips::DIV : Mips::DIVu);
421421 MOp = Mips::MFHI;
422422 }
423 SDNode *Node = CurDAG->getMachineNode(Op, dl, MVT::Flag, Op1, Op2);
423 SDNode *Node = CurDAG->getMachineNode(Op, dl, MVT::Glue, Op1, Op2);
424424
425425 SDValue InFlag = SDValue(Node, 0);
426426 return CurDAG->getMachineNode(MOp, dl, MVT::i32, InFlag);
473473 SDValue InFlag;
474474
475475 // Skip the incomming flag if present
476 if (Node->getOperand(LastOpNum).getValueType() == MVT::Flag)
476 if (Node->getOperand(LastOpNum).getValueType() == MVT::Glue)
477477 LastOpNum--;
478478
479479 if ( (isa(Callee)) ||
495495 Chain = CurDAG->getCopyToReg(Chain, dl, Mips::T9, Callee, InFlag);
496496
497497 // Map the JmpLink operands to JALR
498 SDVTList NodeTys = CurDAG->getVTList(MVT::Other, MVT::Flag);
498 SDVTList NodeTys = CurDAG->getVTList(MVT::Other, MVT::Glue);
499499 SmallVector Ops;
500500 Ops.push_back(CurDAG->getRegister(Mips::T9, MVT::i32));
501501
904904 // = Chain, Callee, Reg#1, Reg#2, ...
905905 //
906906 // Returns a chain & a flag for retval copy to use.
907 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
907 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
908908 SmallVector Ops;
909909 Ops.push_back(Chain);
910910 Ops.push_back(Callee);
634634 }
635635 case ISD::SETNE: {
636636 SDValue AD =
637 SDValue(CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
637 SDValue(CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Glue,
638638 Op, getI32Imm(~0U)), 0);
639639 return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op,
640640 AD.getValue(1));
656656 switch (CC) {
657657 default: break;
658658 case ISD::SETEQ:
659 Op = SDValue(CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
659 Op = SDValue(CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Glue,
660660 Op, getI32Imm(1)), 0);
661661 return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
662662 SDValue(CurDAG->getMachineNode(PPC::LI, dl,
665665 Op.getValue(1));
666666 case ISD::SETNE: {
667667 Op = SDValue(CurDAG->getMachineNode(PPC::NOR, dl, MVT::i32, Op, Op), 0);
668 SDNode *AD = CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
668 SDNode *AD = CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Glue,
669669 Op, getI32Imm(~0U));
670670 return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDValue(AD, 0),
671671 Op, SDValue(AD, 1));
857857 SDValue N0 = N->getOperand(0);
858858 if ((signed)Imm > 0 && isPowerOf2_32(Imm)) {
859859 SDNode *Op =
860 CurDAG->getMachineNode(PPC::SRAWI, dl, MVT::i32, MVT::Flag,
860 CurDAG->getMachineNode(PPC::SRAWI, dl, MVT::i32, MVT::Glue,
861861 N0, getI32Imm(Log2_32(Imm)));
862862 return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
863863 SDValue(Op, 0), SDValue(Op, 1));
864864 } else if ((signed)Imm < 0 && isPowerOf2_32(-Imm)) {
865865 SDNode *Op =
866 CurDAG->getMachineNode(PPC::SRAWI, dl, MVT::i32, MVT::Flag,
866 CurDAG->getMachineNode(PPC::SRAWI, dl, MVT::i32, MVT::Glue,
867867 N0, getI32Imm(Log2_32(-Imm)));
868868 SDValue PT =
869869 SDValue(CurDAG->getMachineNode(PPC::ADDZE, dl, MVT::i32,
10151015 // FIXME: Implement this optzn for PPC64.
10161016 N->getValueType(0) == MVT::i32) {
10171017 SDNode *Tmp =
1018 CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
1018 CurDAG->getMachineNode(PPC::ADDIC, dl, MVT::i32, MVT::Glue,
10191019 N->getOperand(0), getI32Imm(~0U));
10201020 return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32,
10211021 SDValue(Tmp, 0), N->getOperand(0),
24262426
24272427 EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
24282428 NodeTys.push_back(MVT::Other); // Returns a chain
2429 NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
2429 NodeTys.push_back(MVT::Glue); // Returns a flag for retval copy to use.
24302430
24312431 unsigned CallOpc = isSVR4ABI ? PPCISD::CALL_SVR4 : PPCISD::CALL_Darwin;
24322432
25132513
25142514 // Load the address of the function entry point from the function
25152515 // descriptor.
2516 SDVTList VTs = DAG.getVTList(MVT::i64, MVT::Other, MVT::Flag);
2516 SDVTList VTs = DAG.getVTList(MVT::i64, MVT::Other, MVT::Glue);
25172517 SDValue LoadFuncPtr = DAG.getNode(PPCISD::LOAD, dl, VTs, MTCTROps,
25182518 InFlag.getNode() ? 3 : 2);
25192519 Chain = LoadFuncPtr.getValue(1);
25402540 // prevents the register allocator from allocating it), resulting in an
25412541 // additional register being allocated and an unnecessary move instruction
25422542 // being generated.
2543 VTs = DAG.getVTList(MVT::Other, MVT::Flag);
2543 VTs = DAG.getVTList(MVT::Other, MVT::Glue);
25442544 SDValue LoadTOCPtr = DAG.getNode(PPCISD::LOAD_TOC, dl, VTs, Chain,
25452545 Callee, InFlag);
25462546 Chain = LoadTOCPtr.getValue(0);
25572557
25582558 NodeTys.clear();
25592559 NodeTys.push_back(MVT::Other);
2560 NodeTys.push_back(MVT::Flag);
2560 NodeTys.push_back(MVT::Glue);
25612561 Ops.push_back(Chain);
25622562 CallOpc = isSVR4ABI ? PPCISD::BCTRL_SVR4 : PPCISD::BCTRL_Darwin;
25632563 Callee.setNode(0);
26712671 // stack frame. If caller and callee belong to the same module (and have the
26722672 // same TOC), the NOP will remain unchanged.
26732673 if (!isTailCall && PPCSubTarget.isSVR4ABI()&& PPCSubTarget.isPPC64()) {
2674 SDVTList VTs = DAG.getVTList(MVT::Other, MVT::Flag);
2674 SDVTList VTs = DAG.getVTList(MVT::Other, MVT::Glue);
26752675 if (CallOpc == PPCISD::BCTRL_SVR4) {
26762676 // This is a call through a function pointer.
26772677 // Restore the caller TOC from the save area into R2.
26862686 InFlag = Chain.getValue(1);
26872687 } else {
26882688 // Otherwise insert NOP.
2689 InFlag = DAG.getNode(PPCISD::NOP, dl, MVT::Flag, InFlag);
2689 InFlag = DAG.getNode(PPCISD::NOP, dl, MVT::Glue, InFlag);
26902690 }
26912691 }
26922692
36263626
36273627 // Save FP Control Word to register
36283628 NodeTys.push_back(MVT::f64); // return register
3629 NodeTys.push_back(MVT::Flag); // unused in this context
3629 NodeTys.push_back(MVT::Glue); // unused in this context
36303630 SDValue Chain = DAG.getNode(PPCISD::MFFS, dl, NodeTys, &InFlag, 0);
36313631
36323632 // Save FP register to stack slot
42534253 };
42544254 std::vector VTs;
42554255 VTs.push_back(Op.getOperand(2).getValueType());
4256 VTs.push_back(MVT::Flag);
4256 VTs.push_back(MVT::Glue);
42574257 SDValue CompNode = DAG.getNode(PPCISD::VCMPo, dl, VTs, Ops, 3);
42584258
42594259 // Now that we have the comparison, emit a copy from the CR to a GPR.
44454445 SDValue Ops[4], Result, MFFSreg, InFlag, FPreg;
44464446
44474447 NodeTys.push_back(MVT::f64); // Return register
4448 NodeTys.push_back(MVT::Flag); // Returns a flag for later insns
4448 NodeTys.push_back(MVT::Glue); // Returns a flag for later insns
44494449 Result = DAG.getNode(PPCISD::MFFS, dl, NodeTys, &InFlag, 0);
44504450 MFFSreg = Result.getValue(0);
44514451 InFlag = Result.getValue(1);
44524452
44534453 NodeTys.clear();
4454 NodeTys.push_back(MVT::Flag); // Returns a flag
4454 NodeTys.push_back(MVT::Glue); // Returns a flag
44554455 Ops[0] = DAG.getConstant(31, MVT::i32);
44564456 Ops[1] = InFlag;
44574457 Result = DAG.getNode(PPCISD::MTFSB1, dl, NodeTys, Ops, 2);
44584458 InFlag = Result.getValue(0);
44594459
44604460 NodeTys.clear();
4461 NodeTys.push_back(MVT::Flag); // Returns a flag
4461 NodeTys.push_back(MVT::Glue); // Returns a flag
44624462 Ops[0] = DAG.getConstant(30, MVT::i32);
44634463 Ops[1] = InFlag;
44644464 Result = DAG.getNode(PPCISD::MTFSB0, dl, NodeTys, Ops, 2);
44664466
44674467 NodeTys.clear();
44684468 NodeTys.push_back(MVT::f64); // result of add
4469 NodeTys.push_back(MVT::Flag); // Returns a flag
4469 NodeTys.push_back(MVT::Glue); // Returns a flag
44704470 Ops[0] = Lo;
44714471 Ops[1] = Hi;
44724472 Ops[2] = InFlag;
52725272 DAG.getConstant(CompareOpc, MVT::i32)
52735273 };
52745274 VTs.push_back(LHS.getOperand(2).getValueType());
5275 VTs.push_back(MVT::Flag);
5275 VTs.push_back(MVT::Glue);
52765276 SDValue CompNode = DAG.getNode(PPCISD::VCMPo, dl, VTs, Ops, 3);
52775277
52785278 // Unpack the result based on how the target uses it.
157157 } else {
158158 TopPart = CurDAG->getRegister(SP::G0, MVT::i32);
159159 }
160 TopPart = SDValue(CurDAG->getMachineNode(SP::WRYrr, dl, MVT::Flag, TopPart,
160 TopPart = SDValue(CurDAG->getMachineNode(SP::WRYrr, dl, MVT::Glue, TopPart,
161161 CurDAG->getRegister(SP::G0, MVT::i32)), 0);
162162
163163 // FIXME: Handle div by immediate.
171171 SDValue MulLHS = N->getOperand(0);
172172 SDValue MulRHS = N->getOperand(1);
173173 unsigned Opcode = N->getOpcode() == ISD::MULHU ? SP::UMULrr : SP::SMULrr;
174 SDNode *Mul = CurDAG->getMachineNode(Opcode, dl, MVT::i32, MVT::Flag,
174 SDNode *Mul = CurDAG->getMachineNode(Opcode, dl, MVT::i32, MVT::Glue,
175175 MulLHS, MulRHS);
176176 // The high part is in the Y register.
177177 return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDValue(Mul, 1));
487487
488488 std::vector NodeTys;
489489 NodeTys.push_back(MVT::Other); // Returns a chain
490 NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
490 NodeTys.push_back(MVT::Glue); // Returns a flag for retval copy to use.
491491 SDValue Ops[] = { Chain, Callee, InFlag };
492492 Chain = DAG.getNode(SPISD::CALL, dl, NodeTys, Ops, InFlag.getNode() ? 3 : 2);
493493 InFlag = Chain.getValue(1);
833833 if (LHS.getValueType() == MVT::i32) {
834834 std::vector VTs;
835835 VTs.push_back(MVT::i32);
836 VTs.push_back(MVT::Flag);
836 VTs.push_back(MVT::Glue);
837837 SDValue Ops[2] = { LHS, RHS };
838838 CompareFlag = DAG.getNode(SPISD::CMPICC, dl, VTs, Ops, 2).getValue(1);
839839 if (SPCC == ~0U) SPCC = IntCondCCodeToICC(CC);
840840 Opc = SPISD::BRICC;
841841 } else {
842 CompareFlag = DAG.getNode(SPISD::CMPFCC, dl, MVT::Flag, LHS, RHS);
842 CompareFlag = DAG.getNode(SPISD::CMPFCC, dl, MVT::Glue, LHS, RHS);
843843 if (SPCC == ~0U) SPCC = FPCondCCodeToFCC(CC);
844844 Opc = SPISD::BRFCC;
845845 }
864864 if (LHS.getValueType() == MVT::i32) {
865865 std::vector VTs;
866866 VTs.push_back(LHS.getValueType()); // subcc returns a value
867 VTs.push_back(MVT::Flag);
867 VTs.push_back(MVT::Glue);
868868 SDValue Ops[2] = { LHS, RHS };
869869 CompareFlag = DAG.getNode(SPISD::CMPICC, dl, VTs, Ops, 2).getValue(1);
870870 Opc = SPISD::SELECT_ICC;
871871 if (SPCC == ~0U) SPCC = IntCondCCodeToICC(CC);
872872 } else {
873 CompareFlag = DAG.getNode(SPISD::CMPFCC, dl, MVT::Flag, LHS, RHS);
873 CompareFlag = DAG.getNode(SPISD::CMPFCC, dl, MVT::Glue, LHS, RHS);
874874 Opc = SPISD::SELECT_FCC;
875875 if (SPCC == ~0U) SPCC = FPCondCCodeToFCC(CC);
876876 }
470470 Callee = DAG.getTargetExternalSymbol(E->getSymbol(), getPointerTy());
471471
472472 // Returns a chain & a flag for retval copy to use.
473 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
473 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
474474 SmallVector Ops;
475475 Ops.push_back(Chain);
476476 Ops.push_back(Callee);
709709 SDValue SystemZCC;
710710 SDValue Flag = EmitCmp(LHS, RHS, CC, SystemZCC, DAG);
711711
712 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Flag);
712 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Glue);
713713 SmallVector Ops;
714714 Ops.push_back(TrueV);
715715 Ops.push_back(FalseV);
16741674 SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, N1.getOperand(0),
16751675 InFlag };
16761676 SDNode *CNode =
1677 CurDAG->getMachineNode(MOpc, dl, MVT::Other, MVT::Flag, Ops,
1677 CurDAG->getMachineNode(MOpc, dl, MVT::Other, MVT::Glue, Ops,
16781678 array_lengthof(Ops));
16791679 InFlag = SDValue(CNode, 1);
16801680
16811681 // Update the chain.
16821682 ReplaceUses(N1.getValue(1), SDValue(CNode, 0));
16831683 } else {
1684 SDNode *CNode = CurDAG->getMachineNode(Opc, dl, MVT::Flag, N1, InFlag);
1684 SDNode *CNode = CurDAG->getMachineNode(Opc, dl, MVT::Glue, N1, InFlag);
16851685 InFlag = SDValue(CNode, 0);
16861686 }
16871687
18061806 if (isSigned && !signBitIsZero) {
18071807 // Sign extend the low part into the high part.
18081808 InFlag =
1809 SDValue(CurDAG->getMachineNode(SExtOpcode, dl, MVT::Flag, InFlag),0);
1809 SDValue(CurDAG->getMachineNode(SExtOpcode, dl, MVT::Glue, InFlag),0);
18101810 } else {
18111811 // Zero out the high part, effectively zero extending the input.
18121812 SDValue ClrNode =
18201820 SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, N1.getOperand(0),
18211821 InFlag };
18221822 SDNode *CNode =
1823 CurDAG->getMachineNode(MOpc, dl, MVT::Other, MVT::Flag, Ops,
1823 CurDAG->getMachineNode(MOpc, dl, MVT::Other, MVT::Glue, Ops,
18241824 array_lengthof(Ops));
18251825 InFlag = SDValue(CNode, 1);
18261826 // Update the chain.
18271827 ReplaceUses(N1.getValue(1), SDValue(CNode, 0));
18281828 } else {
18291829 InFlag =
1830 SDValue(CurDAG->getMachineNode(Opc, dl, MVT::Flag, N1, InFlag), 0);
1830 SDValue(CurDAG->getMachineNode(Opc, dl, MVT::Glue, N1, InFlag), 0);
18311831 }
18321832
18331833 // Prevent use of AH in a REX instruction by referencing AX instead.
255255 setOperationAction(ISD::SREM, VT, Expand);
256256 setOperationAction(ISD::UREM, VT, Expand);
257257
258 // Add/Sub overflow ops with MVT::Flags are lowered to EFLAGS dependences.
258 // Add/Sub overflow ops with MVT::Glues are lowered to EFLAGS dependences.
259259 setOperationAction(ISD::ADDC, VT, Custom);
260260 setOperationAction(ISD::ADDE, VT, Custom);
261261 setOperationAction(ISD::SUBC, VT, Custom);
13991399 if (CopyVT == MVT::f64) Opc = isST0 ? X86::FpGET_ST0_64:X86::FpGET_ST1_64;
14001400 if (CopyVT == MVT::f80) Opc = isST0 ? X86::FpGET_ST0_80:X86::FpGET_ST1_80;
14011401 SDValue Ops[] = { Chain, InFlag };
1402 Chain = SDValue(DAG.getMachineNode(Opc, dl, CopyVT, MVT::Other, MVT::Flag,
1402 Chain = SDValue(DAG.getMachineNode(Opc, dl, CopyVT, MVT::Other, MVT::Glue,
14031403 Ops, 2), 1);
14041404 Val = Chain.getValue(0);
14051405
21762176 }
21772177
21782178 // Returns a chain & a flag for retval copy to use.
2179 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
2179 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
21802180 SmallVector Ops;
21812181
21822182 if (!IsSibcall && isTailCall) {
60336033 SDValue *InFlag, const EVT PtrVT, unsigned ReturnReg,
60346034 unsigned char OperandFlags) {
60356035 MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
6036 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
6036 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
60376037 DebugLoc dl = GA->getDebugLoc();
60386038 SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl,
60396039 GA->getValueType(0),
61826182 // Lowering the machine isd will make sure everything is in the right
61836183 // location.
61846184 SDValue Chain = DAG.getEntryNode();
6185 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
6185 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
61866186 SDValue Args[] = { Chain, Offset };
61876187 Chain = DAG.getNode(X86ISD::TLSCALL, DL, NodeTys, Args, 2);
61886188
62896289 SDVTList Tys;
62906290 bool useSSE = isScalarFPTypeInSSEReg(Op.getValueType());
62916291 if (useSSE)
6292 Tys = DAG.getVTList(MVT::f64, MVT::Other, MVT::Flag);
6292 Tys = DAG.getVTList(MVT::f64, MVT::Other, MVT::Glue);
62936293 else
62946294 Tys = DAG.getVTList(Op.getValueType(), MVT::Other);
62956295
73127312
73137313 // X86ISD::CMOV means set the result (which is operand 1) to the RHS if
73147314 // condition is true.
7315 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Flag);
7315 SDVTList VTs = DAG.getVTList(Op.getValueType(), MVT::Glue);
73167316 SDValue Ops[] = { Op2, Op1, CC, Cond };
73177317 return DAG.getNode(X86ISD::CMOV, DL, VTs, Ops, array_lengthof(Ops));
73187318 }
75137513 Chain = DAG.getCopyToReg(Chain, dl, X86::EAX, Size, Flag);
75147514 Flag = Chain.getValue(1);
75157515
7516 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
7516 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
75177517
75187518 Chain = DAG.getNode(X86ISD::WIN_ALLOCA, dl, NodeTys, Chain, Flag);
75197519 Flag = Chain.getValue(1);
85688568 Op.getOperand(3),
85698569 DAG.getTargetConstant(size, MVT::i8),
85708570 cpIn.getValue(1) };
8571 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
8571 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
85728572 MachineMemOperand *MMO = cast(Op)->getMemOperand();
85738573 SDValue Result = DAG.getMemIntrinsicNode(X86ISD::LCMPXCHG_DAG, DL, Tys,
85748574 Ops, 5, T, MMO);
85808580 SDValue X86TargetLowering::LowerREADCYCLECOUNTER(SDValue Op,
85818581 SelectionDAG &DAG) const {
85828582 assert(Subtarget->is64Bit() && "Result not type legalized?");
8583 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
8583 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
85848584 SDValue TheChain = Op.getOperand(0);
85858585 DebugLoc dl = Op.getDebugLoc();
85868586 SDValue rd = DAG.getNode(X86ISD::RDTSC_DAG, dl, Tys, &TheChain, 1);
87748774 return;
87758775 }
87768776 case ISD::READCYCLECOUNTER: {
8777 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
8777 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
87788778 SDValue TheChain = N->getOperand(0);
87798779 SDValue rd = DAG.getNode(X86ISD::RDTSC_DAG, dl, Tys, &TheChain, 1);
87808780 SDValue eax = DAG.getCopyFromReg(rd, dl, X86::EAX, MVT::i32,
88108810 SDValue Ops[] = { swapInH.getValue(0),
88118811 N->getOperand(1),
88128812 swapInH.getValue(1) };
8813 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
8813 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
88148814 MachineMemOperand *MMO = cast(N)->getMemOperand();
88158815 SDValue Result = DAG.getMemIntrinsicNode(X86ISD::LCMPXCHG8_DAG, dl, Tys,
88168816 Ops, 3, T, MMO);
135135 Dst, InFlag);
136136 InFlag = Chain.getValue(1);
137137
138 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
138 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
139139 SDValue Ops[] = { Chain, DAG.getValueType(AVT), InFlag };
140140 Chain = DAG.getNode(X86ISD::REP_STOS, dl, Tys, Ops, array_lengthof(Ops));
141141
149149 X86::ECX,
150150 Left, InFlag);
151151 InFlag = Chain.getValue(1);
152 Tys = DAG.getVTList(MVT::Other, MVT::Flag);
152 Tys = DAG.getVTList(MVT::Other, MVT::Glue);
153153 SDValue Ops[] = { Chain, DAG.getValueType(MVT::i8), InFlag };
154154 Chain = DAG.getNode(X86ISD::REP_STOS, dl, Tys, Ops, array_lengthof(Ops));
155155 } else if (BytesLeft) {
229229 Src, InFlag);
230230 InFlag = Chain.getValue(1);
231231
232 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
232 SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Glue);
233233 SDValue Ops[] = { Chain, DAG.getValueType(AVT), InFlag };
234234 SDValue RepMovs = DAG.getNode(X86ISD::REP_MOVS, dl, Tys, Ops,
235235 array_lengthof(Ops));
925925 // = Chain, Callee, Reg#1, Reg#2, ...
926926 //
927927 // Returns a chain & a flag for retval copy to use.
928 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag);
928 SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
929929 SmallVector Ops;
930930 Ops.push_back(Chain);
931931 Ops.push_back(Callee);
108108 case MVT::ppcf128: return "ppcf128";
109109 case MVT::isVoid: return "isVoid";
110110 case MVT::Other: return "ch";
111 case MVT::Flag: return "flag";
111 case MVT::Glue: return "glue";
112112 case MVT::x86mmx: return "x86mmx";
113113 case MVT::v2i8: return "v2i8";
114114 case MVT::v4i8: return "v4i8";
6363 case MVT::f128: return "MVT::f128";
6464 case MVT::ppcf128: return "MVT::ppcf128";
6565 case MVT::x86mmx: return "MVT::x86mmx";
66 case MVT::Flag: return "MVT::Flag";
66 case MVT::Glue: return "MVT::Glue";
6767 case MVT::isVoid: return "MVT::isVoid";
6868 case MVT::v2i8: return "MVT::v2i8";
6969 case MVT::v4i8: return "MVT::v4i8";
786786
787787 // The non-chain and non-flag results of the newly emitted node get recorded.
788788 for (unsigned i = 0, e = ResultVTs.size(); i != e; ++i) {
789 if (ResultVTs[i] == MVT::Other || ResultVTs[i] == MVT::Flag) break;
789 if (ResultVTs[i] == MVT::Other || ResultVTs[i] == MVT::Glue) break;
790790 OutputOps.push_back(NextRecordedOperandNo++);
791791 }
792792 }