1 //===- PPCRegisterInfo.h - PowerPC Register Information Impl -----*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the PowerPC implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef POWERPC32_REGISTERINFO_H
15 #define POWERPC32_REGISTERINFO_H
18 #include "PPCGenRegisterInfo.h.inc"
25 class PPCRegisterInfo : public PPCGenRegisterInfo {
26 std::map<unsigned, unsigned> ImmToIdxMap;
30 /// Code Generation virtual methods...
31 void storeRegToStackSlot(MachineBasicBlock &MBB,
32 MachineBasicBlock::iterator MBBI,
33 unsigned SrcReg, int FrameIndex,
34 const TargetRegisterClass *RC) const;
36 void loadRegFromStackSlot(MachineBasicBlock &MBB,
37 MachineBasicBlock::iterator MBBI,
38 unsigned DestReg, int FrameIndex,
39 const TargetRegisterClass *RC) const;
41 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
42 unsigned DestReg, unsigned SrcReg,
43 const TargetRegisterClass *RC) const;
45 /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
46 /// copy instructions, turning them into load/store instructions.
47 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
48 int FrameIndex) const;
50 void eliminateCallFramePseudoInstr(MachineFunction &MF,
51 MachineBasicBlock &MBB,
52 MachineBasicBlock::iterator I) const;
54 void eliminateFrameIndex(MachineBasicBlock::iterator II) const;
56 void emitPrologue(MachineFunction &MF) const;
57 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
59 // Debug information queries.
60 unsigned getRARegister() const;
61 unsigned getFrameRegister(MachineFunction &MF) const;
62 void getInitialFrameState(std::vector<MachineMove *> &Moves) const;
65 } // end namespace llvm