X86RegisterInfo.h revision 2505d6b72731628e34097adecc3dc6e26e220e04
1//===- X86RegisterInfo.h - X86 Register Information Impl --------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 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. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file contains the X86 implementation of the MRegisterInfo class. 11// 12//===----------------------------------------------------------------------===// 13 14#ifndef X86REGISTERINFO_H 15#define X86REGISTERINFO_H 16 17#include "llvm/Target/MRegisterInfo.h" 18 19class llvm::Type; 20 21#include "X86GenRegisterInfo.h.inc" 22 23namespace llvm { 24 25struct X86RegisterInfo : public X86GenRegisterInfo { 26 X86RegisterInfo(); 27 28 /// Code Generation virtual methods... 29 void storeRegToStackSlot(MachineBasicBlock &MBB, 30 MachineBasicBlock::iterator MI, 31 unsigned SrcReg, int FrameIndex) const; 32 33 void loadRegFromStackSlot(MachineBasicBlock &MBB, 34 MachineBasicBlock::iterator MI, 35 unsigned DestReg, int FrameIndex) const; 36 37 void copyRegToReg(MachineBasicBlock &MBB, 38 MachineBasicBlock::iterator MI, 39 unsigned DestReg, unsigned SrcReg, 40 const TargetRegisterClass *RC) const; 41 42 /// foldMemoryOperand - If this target supports it, fold a load or store of 43 /// the specified stack slot into the specified machine instruction for the 44 /// specified operand. If this is possible, the target should perform the 45 /// folding and return true, otherwise it should return false. If it folds 46 /// the instruction, it is likely that the MachineInstruction the iterator 47 /// references has been changed. 48 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, 49 unsigned OpNum, 50 int FrameIndex) const; 51 52 53 void eliminateCallFramePseudoInstr(MachineFunction &MF, 54 MachineBasicBlock &MBB, 55 MachineBasicBlock::iterator MI) const; 56 57 void eliminateFrameIndex(MachineBasicBlock::iterator MI) const; 58 59 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 60 61 void emitPrologue(MachineFunction &MF) const; 62 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 63}; 64 65} // End llvm namespace 66 67#endif 68