llvm.org GIT mirror llvm / 2e9919a
Now that DBG_LABEL is updated, we can finally make MachineMove contain an MCSymbol instead of a label index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98482 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
10 changed file(s) with 89 addition(s) and 127 deletion(s). Raw diff Collapse all Expand all
2121 #define LLVM_CODEGEN_MACHINELOCATION_H
2222
2323 namespace llvm {
24
24 class MCSymbol;
25
2526 class MachineLocation {
2627 private:
2728 bool IsRegister; // True if location is a register.
2829 unsigned Register; // gcc/gdb register number.
2930 int Offset; // Displacement if not register.
30
3131 public:
3232 enum {
3333 // The target register number for an abstract frame pointer. The value is
3535 VirtualFP = ~0U
3636 };
3737 MachineLocation()
38 : IsRegister(false)
39 , Register(0)
40 , Offset(0)
41 {}
38 : IsRegister(false), Register(0), Offset(0) {}
4239 explicit MachineLocation(unsigned R)
43 : IsRegister(true)
44 , Register(R)
45 , Offset(0)
46 {}
40 : IsRegister(true), Register(R), Offset(0) {}
4741 MachineLocation(unsigned R, int O)
48 : IsRegister(false)
49 , Register(R)
50 , Offset(O)
51 {}
42 : IsRegister(false), Register(R), Offset(O) {}
5243
5344 // Accessors
5445 bool isReg() const { return IsRegister; }
7364 #endif
7465 };
7566
67 /// MachineMove - This class represents the save or restore of a callee saved
68 /// register that exception or debug info needs to know about.
7669 class MachineMove {
7770 private:
78 unsigned LabelID; // Label ID number for post-instruction
79 // address when result of move takes
80 // effect.
81 MachineLocation Destination; // Move to location.
82 MachineLocation Source; // Move from location.
71 /// Label - Symbol for post-instruction address when result of move takes
72 /// effect.
73 MCSymbol *Label;
8374
75 // Move to & from location.
76 MachineLocation Destination, Source;
8477 public:
85 MachineMove()
86 : LabelID(0)
87 , Destination()
88 , Source()
89 {}
78 MachineMove() : Label(0) {}
9079
91 MachineMove(unsigned ID, MachineLocation &D, MachineLocation &S)
92 : LabelID(ID)
93 , Destination(D)
94 , Source(S)
95 {}
80 MachineMove(MCSymbol *label, MachineLocation &D, MachineLocation &S)
81 : Label(label), Destination(D), Source(S) {}
9682
9783 // Accessors
98 unsigned getLabelID() const { return LabelID; }
84 MCSymbol *getLabel() const { return Label; }
9985 const MachineLocation &getDestination() const { return Destination; }
10086 const MachineLocation &getSource() const { return Source; }
10187 };
246246
247247 for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
248248 const MachineMove &Move = Moves[i];
249 MCSymbol *Label = 0;
250 unsigned LabelID = Move.getLabelID();
249 MCSymbol *Label = Move.getLabel();
251250 // Throw out move if the label is invalid.
252 if (LabelID) {
253 Label = getDWLabel("label", LabelID);
254 if (!Label->isDefined()) continue; // Not emitted, in dead code.
255 }
251 if (Label && !Label->isDefined()) continue; // Not emitted, in dead code.
256252
257253 const MachineLocation &Dst = Move.getDestination();
258254 const MachineLocation &Src = Move.getSource();
6767 unsigned PointerSize = TD->getPointerSize();
6868 int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
6969 PointerSize : -PointerSize;
70 bool IsLocal = false;
71 unsigned BaseLabelID = 0;
70 MCSymbol *BaseLabel = 0;
7271
7372 for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
7473 const MachineMove &Move = Moves[i];
75 unsigned LabelID = Move.getLabelID();
76 MCSymbol *Label = LabelID ? MMI->getLabelSym(LabelID) : 0;
74 MCSymbol *Label = Move.getLabel();
7775
7876 // Throw out move if the label is invalid.
7977 if (Label && !Label->isDefined())
8078 continue;
8179
8280 intptr_t LabelPtr = 0;
83 if (LabelID) LabelPtr = JCE->getLabelAddress(Label);
81 if (Label) LabelPtr = JCE->getLabelAddress(Label);
8482
8583 const MachineLocation &Dst = Move.getDestination();
8684 const MachineLocation &Src = Move.getSource();
8785
8886 // Advance row if new location.
89 if (BaseLabelPtr && LabelID && (BaseLabelID != LabelID || !IsLocal)) {
87 if (BaseLabelPtr && Label && BaseLabel != Label) {
9088 JCE->emitByte(dwarf::DW_CFA_advance_loc4);
9189 JCE->emitInt32(LabelPtr - BaseLabelPtr);
9290
93 BaseLabelID = LabelID;
91 BaseLabel = Label;
9492 BaseLabelPtr = LabelPtr;
95 IsLocal = true;
9693 }
9794
9895 // If advancing cfa.
711708
712709 for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
713710 const MachineMove &Move = Moves[i];
714 unsigned LabelID = Move.getLabelID();
715 MCSymbol *Label = LabelID ? MMI->getLabelSym(LabelID) : 0;
711 MCSymbol *Label = Move.getLabel();
716712
717713 // Throw out move if the label is invalid.
718714 if (Label && !Label->isDefined())
719715 continue;
720716
721717 intptr_t LabelPtr = 0;
722 if (LabelID) LabelPtr = JCE->getLabelAddress(Label);
718 if (Label) LabelPtr = JCE->getLabelAddress(Label);
723719
724720 const MachineLocation &Dst = Move.getDestination();
725721 const MachineLocation &Src = Move.getSource();
726722
727723 // Advance row if new location.
728 if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) {
724 if (BaseLabelPtr && Label && (BaseLabelPtr != LabelPtr || !IsLocal)) {
729725 FinalSize++;
730726 FinalSize += PointerSize;
731727 BaseLabelPtr = LabelPtr;
435435
436436 // Prepare for debug frame info.
437437 bool hasDebugInfo = MMI && MMI->hasDebugInfo();
438 unsigned FrameLabelId = 0;
438 MCSymbol *FrameLabel = 0;
439439
440440 // Move MBBI back to the beginning of the function.
441441 MBBI = MBB.begin();
451451 FrameSize = -(FrameSize + SPUFrameInfo::minStackSize());
452452 if (hasDebugInfo) {
453453 // Mark effective beginning of when frame pointer becomes valid.
454 FrameLabelId = MMI->NextLabelID();
455 BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL))
456 .addSym(MMI->getLabelSym(FrameLabelId));
454 FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
455 BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addSym(FrameLabel);
457456 }
458457
459458 // Adjust stack pointer, spilling $lr -> 16($sp) and $sp -> -FrameSize($sp)
500499 // Show update of SP.
501500 MachineLocation SPDst(MachineLocation::VirtualFP);
502501 MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize);
503 Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
502 Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc));
504503
505504 // Add callee saved registers to move list.
506505 const std::vector &CSI = MFI->getCalleeSavedInfo();
510509 if (Reg == SPU::R0) continue;
511510 MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
512511 MachineLocation CSSrc(Reg);
513 Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
512 Moves.push_back(MachineMove(FrameLabel, CSDst, CSSrc));
514513 }
515514
516515 // Mark effective beginning of when frame pointer is ready.
517 unsigned ReadyLabelId = MMI->NextLabelID();
518 BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL))
519 .addSym(MMI->getLabelSym(ReadyLabelId));
516 MCSymbol *ReadyLabel = MMI->getLabelSym(MMI->NextLabelID());
517 BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addSym(ReadyLabel);
520518
521519 MachineLocation FPDst(SPU::R1);
522520 MachineLocation FPSrc(MachineLocation::VirtualFP);
523 Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
521 Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc));
524522 }
525523 } else {
526524 // This is a leaf function -- insert a branch hint iff there are
12861286 UnwindTablesMandatory;
12871287
12881288 // Prepare for frame info.
1289 unsigned FrameLabelId = 0;
1289 MCSymbol *FrameLabel = 0;
12901290
12911291 // Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it,
12921292 // process it.
14451445 // reverse order.
14461446 if (needsFrameMoves) {
14471447 // Mark effective beginning of when frame pointer becomes valid.
1448 FrameLabelId = MMI->NextLabelID();
1449 BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL))
1450 .addSym(MMI->getLabelSym(FrameLabelId));
1448 FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
1449 BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addSym(FrameLabel);
14511450
14521451 // Show update of SP.
14531452 if (NegFrameSize) {
14541453 MachineLocation SPDst(MachineLocation::VirtualFP);
14551454 MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize);
1456 Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
1455 Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc));
14571456 } else {
14581457 MachineLocation SP(isPPC64 ? PPC::X31 : PPC::R31);
1459 Moves.push_back(MachineMove(FrameLabelId, SP, SP));
1458 Moves.push_back(MachineMove(FrameLabel, SP, SP));
14601459 }
14611460
14621461 if (HasFP) {
14631462 MachineLocation FPDst(MachineLocation::VirtualFP, FPOffset);
14641463 MachineLocation FPSrc(isPPC64 ? PPC::X31 : PPC::R31);
1465 Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
1464 Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc));
14661465 }
14671466
14681467 if (MustSaveLR) {
14691468 MachineLocation LRDst(MachineLocation::VirtualFP, LROffset);
14701469 MachineLocation LRSrc(isPPC64 ? PPC::LR8 : PPC::LR);
1471 Moves.push_back(MachineMove(FrameLabelId, LRDst, LRSrc));
1472 }
1473 }
1474
1475 unsigned ReadyLabelId = 0;
1470 Moves.push_back(MachineMove(FrameLabel, LRDst, LRSrc));
1471 }
1472 }
1473
1474 MCSymbol *ReadyLabel = 0;
14761475
14771476 // If there is a frame pointer, copy R1 into R31
14781477 if (HasFP) {
14871486 }
14881487
14891488 if (needsFrameMoves) {
1490 ReadyLabelId = MMI->NextLabelID();
1489 ReadyLabel = MMI->getLabelSym(MMI->NextLabelID());
14911490
14921491 // Mark effective beginning of when frame pointer is ready.
1493 BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL))
1494 .addSym(MMI->getLabelSym(ReadyLabelId));
1492 BuildMI(MBB, MBBI, dl, TII.get(PPC::DBG_LABEL)).addSym(ReadyLabel);
14951493
14961494 MachineLocation FPDst(HasFP ? (isPPC64 ? PPC::X31 : PPC::R31) :
14971495 (isPPC64 ? PPC::X1 : PPC::R1));
14981496 MachineLocation FPSrc(MachineLocation::VirtualFP);
1499 Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc));
1497 Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc));
15001498 }
15011499 }
15021500
15031501 if (needsFrameMoves) {
1504 unsigned LabelId = HasFP ? ReadyLabelId : FrameLabelId;
1502 MCSymbol *Label = HasFP ? ReadyLabel : FrameLabel;
15051503
15061504 // Add callee saved registers to move list.
15071505 const std::vector &CSI = MFI->getCalleeSavedInfo();
15111509 if (Reg == PPC::LR || Reg == PPC::LR8 || Reg == PPC::RM) continue;
15121510 MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
15131511 MachineLocation CSSrc(Reg);
1514 Moves.push_back(MachineMove(LabelId, CSDst, CSSrc));
1512 Moves.push_back(MachineMove(Label, CSDst, CSSrc));
15151513 }
15161514 }
15171515 }
796796 }
797797
798798 void X86RegisterInfo::emitCalleeSavedFrameMoves(MachineFunction &MF,
799 unsigned LabelId,
799 MCSymbol *Label,
800800 unsigned FramePtr) const {
801801 MachineFrameInfo *MFI = MF.getFrameInfo();
802802 MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
859859
860860 MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
861861 MachineLocation CSSrc(Reg);
862 Moves.push_back(MachineMove(LabelId, CSDst, CSSrc));
862 Moves.push_back(MachineMove(Label, CSDst, CSSrc));
863863 }
864864 }
865865
958958
959959 if (needsFrameMoves) {
960960 // Mark the place where EBP/RBP was saved.
961 unsigned FrameLabelId = MMI->NextLabelID();
962 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
963 .addSym(MMI->getLabelSym(FrameLabelId));
961 MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
962 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(FrameLabel);
964963
965964 // Define the current CFA rule to use the provided offset.
966965 if (StackSize) {
967966 MachineLocation SPDst(MachineLocation::VirtualFP);
968967 MachineLocation SPSrc(MachineLocation::VirtualFP, 2 * stackGrowth);
969 Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
968 Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc));
970969 } else {
971970 // FIXME: Verify & implement for FP
972971 MachineLocation SPDst(StackPtr);
973972 MachineLocation SPSrc(StackPtr, stackGrowth);
974 Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
973 Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc));
975974 }
976975
977976 // Change the rule for the FramePtr to be an "offset" rule.
978977 MachineLocation FPDst(MachineLocation::VirtualFP, 2 * stackGrowth);
979978 MachineLocation FPSrc(FramePtr);
980 Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
979 Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc));
981980 }
982981
983982 // Update EBP with the new base value...
987986
988987 if (needsFrameMoves) {
989988 // Mark effective beginning of when frame pointer becomes valid.
990 unsigned FrameLabelId = MMI->NextLabelID();
991 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
992 .addSym(MMI->getLabelSym(FrameLabelId));
989 MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
990 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(FrameLabel);
993991
994992 // Define the current CFA to use the EBP/RBP register.
995993 MachineLocation FPDst(FramePtr);
996994 MachineLocation FPSrc(MachineLocation::VirtualFP);
997 Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc));
995 Moves.push_back(MachineMove(FrameLabel, FPDst, FPSrc));
998996 }
999997
1000998 // Mark the FramePtr as live-in in every block except the entry.
10281026
10291027 if (!HasFP && needsFrameMoves) {
10301028 // Mark callee-saved push instruction.
1031 unsigned LabelId = MMI->NextLabelID();
1032 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
1033 .addSym(MMI->getLabelSym(LabelId));
1029 MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID());
1030 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(Label);
10341031
10351032 // Define the current CFA rule to use the provided offset.
10361033 unsigned Ptr = StackSize ?
10371034 MachineLocation::VirtualFP : StackPtr;
10381035 MachineLocation SPDst(Ptr);
10391036 MachineLocation SPSrc(Ptr, StackOffset);
1040 Moves.push_back(MachineMove(LabelId, SPDst, SPSrc));
1037 Moves.push_back(MachineMove(Label, SPDst, SPSrc));
10411038 StackOffset += stackGrowth;
10421039 }
10431040 }
11011098
11021099 if ((NumBytes || PushedRegs) && needsFrameMoves) {
11031100 // Mark end of stack pointer adjustment.
1104 unsigned LabelId = MMI->NextLabelID();
1105 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL))
1106 .addSym(MMI->getLabelSym(LabelId));
1101 MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID());
1102 BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addSym(Label);
11071103
11081104 if (!HasFP && NumBytes) {
11091105 // Define the current CFA rule to use the provided offset.
11111107 MachineLocation SPDst(MachineLocation::VirtualFP);
11121108 MachineLocation SPSrc(MachineLocation::VirtualFP,
11131109 -StackSize + stackGrowth);
1114 Moves.push_back(MachineMove(LabelId, SPDst, SPSrc));
1110 Moves.push_back(MachineMove(Label, SPDst, SPSrc));
11151111 } else {
11161112 // FIXME: Verify & implement for FP
11171113 MachineLocation SPDst(StackPtr);
11181114 MachineLocation SPSrc(StackPtr, stackGrowth);
1119 Moves.push_back(MachineMove(LabelId, SPDst, SPSrc));
1115 Moves.push_back(MachineMove(Label, SPDst, SPSrc));
11201116 }
11211117 }
11221118
11231119 // Emit DWARF info specifying the offsets of the callee-saved registers.
11241120 if (PushedRegs)
1125 emitCalleeSavedFrameMoves(MF, LabelId, HasFP ? FramePtr : StackPtr);
1121 emitCalleeSavedFrameMoves(MF, Label, HasFP ? FramePtr : StackPtr);
11261122 }
11271123 }
11281124
148148 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
149149 RegScavenger *RS = NULL) const;
150150
151 void emitCalleeSavedFrameMoves(MachineFunction &MF, unsigned LabelId,
151 void emitCalleeSavedFrameMoves(MachineFunction &MF, MCSymbol *Label,
152152 unsigned FramePtr) const;
153153 void emitPrologue(MachineFunction &MF) const;
154154 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
428428 storeRegToStackSlot(MBB, MI, it->getReg(), true,
429429 it->getFrameIdx(), it->getRegClass());
430430 if (emitFrameMoves) {
431 unsigned SaveLabelId = MMI->NextLabelID();
432 BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL))
433 .addSym(MMI->getLabelSym(SaveLabelId));
434 XFI->getSpillLabels().push_back(
435 std::pair(SaveLabelId, *it));
431 MCSymbol *SaveLabel = MMI->getLabelSym(MMI->NextLabelID());
432 BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL)).addSym(SaveLabel);
433 XFI->getSpillLabels().push_back(std::make_pair(SaveLabel, *it));
436434 }
437435 }
438436 return true;
3030 int LRSpillSlot;
3131 int FPSpillSlot;
3232 int VarArgsFrameIndex;
33 std::vectorunsigned, CalleeSavedInfo> > SpillLabels;
33 std::vectorMCSymbol*, CalleeSavedInfo> > SpillLabels;
3434
3535 public:
3636 XCoreFunctionInfo() :
5959 void setFPSpillSlot(int off) { FPSpillSlot = off; }
6060 int getFPSpillSlot() const { return FPSpillSlot; }
6161
62 std::vectorunsigned, CalleeSavedInfo> >&getSpillLabels() {
62 std::vectorMCSymbol*, CalleeSavedInfo> > &getSpillLabels() {
6363 return SpillLabels;
6464 }
6565 };
455455 std::vector &Moves = MMI->getFrameMoves();
456456
457457 // Show update of SP.
458 unsigned FrameLabelId = MMI->NextLabelID();
459 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
460 .addSym(MMI->getLabelSym(FrameLabelId));
458 MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
459 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(FrameLabel);
461460
462461 MachineLocation SPDst(MachineLocation::VirtualFP);
463462 MachineLocation SPSrc(MachineLocation::VirtualFP, -FrameSize * 4);
464 Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
463 Moves.push_back(MachineMove(FrameLabel, SPDst, SPSrc));
465464
466465 if (LRSavedOnEntry) {
467466 MachineLocation CSDst(MachineLocation::VirtualFP, 0);
468467 MachineLocation CSSrc(XCore::LR);
469 Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
468 Moves.push_back(MachineMove(FrameLabel, CSDst, CSSrc));
470469 }
471470 }
472471 if (saveLR) {
475474 MBB.addLiveIn(XCore::LR);
476475
477476 if (emitFrameMoves) {
478 unsigned SaveLRLabelId = MMI->NextLabelID();
479 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
480 .addSym(MMI->getLabelSym(SaveLRLabelId));
477 MCSymbol *SaveLRLabel = MMI->getLabelSym(MMI->NextLabelID());
478 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(SaveLRLabel);
481479 MachineLocation CSDst(MachineLocation::VirtualFP, LRSpillOffset);
482480 MachineLocation CSSrc(XCore::LR);
483 MMI->getFrameMoves().push_back(MachineMove(SaveLRLabelId,
484 CSDst, CSSrc));
481 MMI->getFrameMoves().push_back(MachineMove(SaveLRLabel, CSDst, CSSrc));
485482 }
486483 }
487484 }
493490 // R10 is live-in. It is killed at the spill.
494491 MBB.addLiveIn(XCore::R10);
495492 if (emitFrameMoves) {
496 unsigned SaveR10LabelId = MMI->NextLabelID();
497 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
498 .addSym(MMI->getLabelSym(SaveR10LabelId));
493 MCSymbol *SaveR10Label = MMI->getLabelSym(MMI->NextLabelID());
494 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(SaveR10Label);
499495 MachineLocation CSDst(MachineLocation::VirtualFP, FPSpillOffset);
500496 MachineLocation CSSrc(XCore::R10);
501 MMI->getFrameMoves().push_back(MachineMove(SaveR10LabelId,
502 CSDst, CSSrc));
497 MMI->getFrameMoves().push_back(MachineMove(SaveR10Label, CSDst, CSSrc));
503498 }
504499 // Set the FP from the SP.
505500 unsigned FramePtr = XCore::R10;
507502 .addImm(0);
508503 if (emitFrameMoves) {
509504 // Show FP is now valid.
510 unsigned FrameLabelId = MMI->NextLabelID();
511 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL))
512 .addSym(MMI->getLabelSym(FrameLabelId));
505 MCSymbol *FrameLabel = MMI->getLabelSym(MMI->NextLabelID());
506 BuildMI(MBB, MBBI, dl, TII.get(XCore::DBG_LABEL)).addSym(FrameLabel);
513507 MachineLocation SPDst(FramePtr);
514508 MachineLocation SPSrc(MachineLocation::VirtualFP);
515 MMI->getFrameMoves().push_back(MachineMove(FrameLabelId, SPDst, SPSrc));
509 MMI->getFrameMoves().push_back(MachineMove(FrameLabel, SPDst, SPSrc));
516510 }
517511 }
518512
519513 if (emitFrameMoves) {
520514 // Frame moves for callee saved.
521515 std::vector &Moves = MMI->getFrameMoves();
522 std::vectorunsigned, CalleeSavedInfo> >&SpillLabels =
516 std::vectorMCSymbol*, CalleeSavedInfo> >&SpillLabels =
523517 XFI->getSpillLabels();
524518 for (unsigned I = 0, E = SpillLabels.size(); I != E; ++I) {
525 unsigned SpillLabel = SpillLabels[I].first;
519 MCSymbol *SpillLabel = SpillLabels[I].first;
526520 CalleeSavedInfo &CSI = SpillLabels[I].second;
527521 int Offset = MFI->getObjectOffset(CSI.getFrameIdx());
528522 unsigned Reg = CSI.getReg();