1 //===- X86RegisterInfo.h - X86 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 X86 implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86REGISTERINFO_H
15 #define X86REGISTERINFO_H
17 #include "llvm/Target/MRegisterInfo.h"
21 #include "X86GenRegisterInfo.h.inc"
25 struct X86RegisterInfo : public X86GenRegisterInfo {
27 const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
29 /// Code Generation virtual methods...
30 void storeRegToStackSlot(MachineBasicBlock &MBB,
31 MachineBasicBlock::iterator MI,
32 unsigned SrcReg, int FrameIndex) const;
34 void loadRegFromStackSlot(MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MI,
36 unsigned DestReg, int FrameIndex) const;
38 void copyRegToReg(MachineBasicBlock &MBB,
39 MachineBasicBlock::iterator MI,
40 unsigned DestReg, unsigned SrcReg,
41 const TargetRegisterClass *RC) const;
43 /// foldMemoryOperand - If this target supports it, fold a load or store of
44 /// the specified stack slot into the specified machine instruction for the
45 /// specified operand. If this is possible, the target should perform the
46 /// folding and return true, otherwise it should return false. If it folds
47 /// the instruction, it is likely that the MachineInstruction the iterator
48 /// references has been changed.
49 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
51 int FrameIndex) const;
54 void eliminateCallFramePseudoInstr(MachineFunction &MF,
55 MachineBasicBlock &MBB,
56 MachineBasicBlock::iterator MI) const;
58 void eliminateFrameIndex(MachineBasicBlock::iterator MI) const;
60 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
62 void emitPrologue(MachineFunction &MF) const;
63 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
66 } // End llvm namespace