llvm.org GIT mirror llvm / 97de913
eliminateFrameIndex() change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36626 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 12 years ago
12 changed file(s) with 25 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
688688 }
689689
690690 void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
691 RegScavenger *RS) const{
691 int SPAdj, RegScavenger *RS) const{
692692 unsigned i = 0;
693693 MachineInstr &MI = *II;
694694 MachineBasicBlock &MBB = *MI.getParent();
704704 unsigned FrameReg = ARM::SP;
705705 int FrameIndex = MI.getOperand(i).getFrameIndex();
706706 int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
707 MF.getFrameInfo()->getStackSize();
707 MF.getFrameInfo()->getStackSize() + SPAdj;
708708
709709 if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex))
710710 Offset -= AFI->getGPRCalleeSavedArea1Offset();
713713 else if (AFI->isDPRCalleeSavedAreaFrame(FrameIndex))
714714 Offset -= AFI->getDPRCalleeSavedAreaOffset();
715715 else if (hasFP(MF)) {
716 assert(SPAdj == 0 && "Unexpected");
716717 // There is alloca()'s in this function, must reference off the frame
717718 // pointer instead.
718719 FrameReg = getFrameRegister(MF);
987988 unsigned ScratchReg = findScratchRegister(RS, &ARM::GPRRegClass, AFI);
988989 if (ScratchReg == 0)
989990 // No register is "free". Scavenge a register.
990 ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II);
991 ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II, SPAdj);
991992 emitARMRegPlusImmediate(MBB, II, ScratchReg, FrameReg,
992993 isSub ? -Offset : Offset, TII);
993994 MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
8484 MachineBasicBlock::iterator I) const;
8585
8686 void eliminateFrameIndex(MachineBasicBlock::iterator II,
87 RegScavenger *RS = NULL) const;
87 int SPAdj, RegScavenger *RS = NULL) const;
8888
8989 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
9090 RegScavenger *RS = NULL) const;
254254 //<- SP
255255
256256 void AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
257 RegScavenger *RS) const {
257 int SPAdj, RegScavenger *RS) const {
258 assert(SPAdj == 0 && "Unexpected");
259
258260 unsigned i = 0;
259261 MachineInstr &MI = *II;
260262 MachineBasicBlock &MBB = *MI.getParent();
6060 MachineBasicBlock::iterator I) const;
6161
6262 void eliminateFrameIndex(MachineBasicBlock::iterator II,
63 RegScavenger *RS = NULL) const;
63 int SPAdj, RegScavenger *RS = NULL) const;
6464
6565 //void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
6666
176176 }
177177
178178 void IA64RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
179 RegScavenger *RS)const{
179 int SPAdj, RegScavenger *RS)const{
180 assert(SPAdj == 0 && "Unexpected");
181
180182 unsigned i = 0;
181183 MachineInstr &MI = *II;
182184 MachineBasicBlock &MBB = *MI.getParent();
5959 MachineBasicBlock::iterator MI) const;
6060
6161 void eliminateFrameIndex(MachineBasicBlock::iterator MI,
62 RegScavenger *RS = NULL) const;
62 int SPAdj, RegScavenger *RS = NULL) const;
6363
6464 void emitPrologue(MachineFunction &MF) const;
6565 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
588588 }
589589
590590 void PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
591 RegScavenger *RS) const {
591 int SPAdj, RegScavenger *RS) const {
592 assert(SPAdj == 0 && "Unexpected");
593
592594 // Get the instruction.
593595 MachineInstr &MI = *II;
594596 // Get the instruction's basic block.
7979
8080 void lowerDynamicAlloc(MachineBasicBlock::iterator II) const;
8181 void eliminateFrameIndex(MachineBasicBlock::iterator II,
82 RegScavenger *RS = NULL) const;
82 int SPAdj, RegScavenger *RS = NULL) const;
8383
8484 /// determineFrameLayout - Determine the size of the frame and maximum call
8585 /// frame size.
164164 }
165165
166166 void SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
167 RegScavenger *RS) const {
167 int SPAdj, RegScavenger *RS) const {
168 assert(SPAdj == 0 && "Unexpected");
169
168170 unsigned i = 0;
169171 MachineInstr &MI = *II;
170172 while (!MI.getOperand(i).isFrameIndex()) {
6363 MachineBasicBlock::iterator I) const;
6464
6565 void eliminateFrameIndex(MachineBasicBlock::iterator II,
66 RegScavenger *RS = NULL) const;
66 int SPAdj, RegScavenger *RS = NULL) const;
6767
6868 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
6969
985985 }
986986
987987 void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
988 RegScavenger *RS) const{
988 int SPAdj, RegScavenger *RS) const{
989 assert(SPAdj == 0 && "Unexpected");
990
989991 unsigned i = 0;
990992 MachineInstr &MI = *II;
991993 MachineFunction &MF = *MI.getParent()->getParent();
9393 MachineBasicBlock::iterator MI) const;
9494
9595 void eliminateFrameIndex(MachineBasicBlock::iterator MI,
96 RegScavenger *RS = NULL) const;
96 int SPAdj, RegScavenger *RS = NULL) const;
9797
9898 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
9999