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 {
28 /// Code Generation virtual methods...
29 void storeRegToStackSlot(MachineBasicBlock &MBB,
30 MachineBasicBlock::iterator MI,
31 unsigned SrcReg, int FrameIndex) const;
33 void loadRegFromStackSlot(MachineBasicBlock &MBB,
34 MachineBasicBlock::iterator MI,
35 unsigned DestReg, int FrameIndex) const;
37 void copyRegToReg(MachineBasicBlock &MBB,
38 MachineBasicBlock::iterator MI,
39 unsigned DestReg, unsigned SrcReg,
40 const TargetRegisterClass *RC) const;
42 unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
45 /// foldMemoryOperand - If this target supports it, fold a load or store of
46 /// the specified stack slot into the specified machine instruction for the
47 /// specified operand. If this is possible, the target should perform the
48 /// folding and return true, otherwise it should return false. If it folds
49 /// the instruction, it is likely that the MachineInstruction the iterator
50 /// references has been changed.
51 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
53 int FrameIndex) const;
56 void eliminateCallFramePseudoInstr(MachineFunction &MF,
57 MachineBasicBlock &MBB,
58 MachineBasicBlock::iterator MI) const;
60 void eliminateFrameIndex(MachineBasicBlock::iterator MI) const;
62 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
64 void emitPrologue(MachineFunction &MF) const;
65 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
68 } // End llvm namespace