LLVM API Documentation
00001 //===- X86RegisterInfo.h - X86 Register Information Impl --------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the X86 implementation of the MRegisterInfo class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef X86REGISTERINFO_H 00015 #define X86REGISTERINFO_H 00016 00017 #include "llvm/Target/MRegisterInfo.h" 00018 00019 class llvm::Type; 00020 00021 #include "X86GenRegisterInfo.h.inc" 00022 00023 namespace llvm { 00024 00025 struct X86RegisterInfo : public X86GenRegisterInfo { 00026 X86RegisterInfo(); 00027 00028 /// Code Generation virtual methods... 00029 void storeRegToStackSlot(MachineBasicBlock &MBB, 00030 MachineBasicBlock::iterator MI, 00031 unsigned SrcReg, int FrameIndex, 00032 const TargetRegisterClass *RC) const; 00033 00034 void loadRegFromStackSlot(MachineBasicBlock &MBB, 00035 MachineBasicBlock::iterator MI, 00036 unsigned DestReg, int FrameIndex, 00037 const TargetRegisterClass *RC) const; 00038 00039 void copyRegToReg(MachineBasicBlock &MBB, 00040 MachineBasicBlock::iterator MI, 00041 unsigned DestReg, unsigned SrcReg, 00042 const TargetRegisterClass *RC) const; 00043 00044 /// foldMemoryOperand - If this target supports it, fold a load or store of 00045 /// the specified stack slot into the specified machine instruction for the 00046 /// specified operand. If this is possible, the target should perform the 00047 /// folding and return true, otherwise it should return false. If it folds 00048 /// the instruction, it is likely that the MachineInstruction the iterator 00049 /// references has been changed. 00050 MachineInstr* foldMemoryOperand(MachineInstr* MI, 00051 unsigned OpNum, 00052 int FrameIndex) const; 00053 00054 /// getCalleeSaveRegs - Return a null-terminated list of all of the 00055 /// callee-save registers on this target. 00056 const unsigned *getCalleeSaveRegs() const; 00057 00058 /// getCalleeSaveRegClasses - Return a null-terminated list of the preferred 00059 /// register classes to spill each callee-saved register with. The order and 00060 /// length of this list match the getCalleeSaveRegs() list. 00061 const TargetRegisterClass* const* getCalleeSaveRegClasses() const; 00062 00063 void eliminateCallFramePseudoInstr(MachineFunction &MF, 00064 MachineBasicBlock &MBB, 00065 MachineBasicBlock::iterator MI) const; 00066 00067 void eliminateFrameIndex(MachineBasicBlock::iterator MI) const; 00068 00069 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; 00070 00071 void emitPrologue(MachineFunction &MF) const; 00072 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; 00073 00074 // Debug information queries. 00075 unsigned getRARegister() const; 00076 unsigned getFrameRegister(MachineFunction &MF) const; 00077 }; 00078 00079 // getX86SubSuperRegister - X86 utility function. It returns the sub or super 00080 // register of a specific X86 register. 00081 // e.g. getX86SubSuperRegister(X86::EAX, MVT::i16) return X86:AX 00082 unsigned getX86SubSuperRegister(unsigned, MVT::ValueType, bool High=false); 00083 00084 } // End llvm namespace 00085 00086 #endif