llvm.org GIT mirror llvm / 7a53bd0
fix the spill code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29583 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 13 years ago
3 changed file(s) with 18 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
147147 Ops.push_back(Chain);
148148 Ops.push_back(Callee);
149149
150 // Add argument registers to the end of the list so that they are known live
151 // into the call.
152 for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
153 Ops.push_back(DAG.getRegister(RegsToPass[i].first,
154 RegsToPass[i].second.getValueType()));
155
150156 unsigned CallOpc = ARMISD::CALL;
151157 if (InFlag.Val)
152158 Ops.push_back(InFlag);
3030 storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
3131 unsigned SrcReg, int FI,
3232 const TargetRegisterClass *RC) const {
33 // On the order of operands here: think "[FI + 0] = SrcReg".
3433 assert (RC == ARM::IntRegsRegisterClass);
35 BuildMI(MBB, I, ARM::str, 3).addFrameIndex(FI).addImm(0).addReg(SrcReg);
34 BuildMI(MBB, I, ARM::str, 3).addReg(SrcReg).addImm(0).addFrameIndex(FI);
3635 }
3736
3837 void ARMRegisterInfo::
4039 unsigned DestReg, int FI,
4140 const TargetRegisterClass *RC) const {
4241 assert (RC == ARM::IntRegsRegisterClass);
43 BuildMI(MBB, I, ARM::ldr, 2, DestReg).addFrameIndex(FI).addImm(0);
42 BuildMI(MBB, I, ARM::ldr, 2, DestReg).addImm(0).addFrameIndex(FI);
4443 }
4544
4645 void ARMRegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
8079 MachineBasicBlock &MBB = *MI.getParent();
8180 MachineFunction &MF = *MBB.getParent();
8281
83 assert (MI.getOpcode() == ARM::ldr);
82 assert (MI.getOpcode() == ARM::ldr ||
83 MI.getOpcode() == ARM::str);
8484
8585 unsigned FrameIdx = 2;
8686 unsigned OffIdx = 1;
9191 assert (MI.getOperand(OffIdx).getImmedValue() == 0);
9292
9393 unsigned StackSize = MF.getFrameInfo()->getStackSize();
94
95 //
96 if (Offset < 0)
97 Offset -= 4;
98 //
9499
95100 Offset += StackSize;
96101
119124 MachineBasicBlock::iterator MBBI = MBB.begin();
120125 MachineFrameInfo *MFI = MF.getFrameInfo();
121126 int NumBytes = (int) MFI->getStackSize();
122
123 //hack
124 assert(NumBytes == 0);
125127
126128 if (MFI->hasCalls()) {
127129 // We reserve argument space for call sites in the function immediately on
None ; RUN: llvm-as < %s | llc -march=arm
0 ; RUN: llvm-as < %s | llc -march=arm
11 %str = internal constant [43 x sbyte] c"Hello World %d %d %d %d %d %d %d %d %d %d\0A\00" ; <[43 x sbyte]*> [#uses=1]
22
33 implementation ; Functions:
55 int %main() {
66 entry:
77 %tmp = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([43 x sbyte]* %str, int 0, uint 0), int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 9, int 10 ) ; [#uses=0]
8 ret int 0
8 %tmp2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([43 x sbyte]* %str, int 0, uint 0), int 10, int 9, int 8, int 7, int 6, int 5, int 4, int 3, int 2, int 1 ) ; [#uses=0]
9 ret int 11
910 }
1011
1112 declare int %printf(sbyte*, ...)