2012-02-28 08:46:26 +01:00
|
|
|
//===-- MipsRegisterInfo.h - Mips Register Information Impl -----*- C++ -*-===//
|
2007-06-06 09:42:06 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 21:36:04 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-06 09:42:06 +02:00
|
|
|
//
|
2011-04-15 23:51:11 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 09:42:06 +02:00
|
|
|
//
|
2008-02-10 19:45:23 +01:00
|
|
|
// This file contains the Mips implementation of the TargetRegisterInfo class.
|
2007-06-06 09:42:06 +02:00
|
|
|
//
|
2011-04-15 23:51:11 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 09:42:06 +02:00
|
|
|
|
|
|
|
#ifndef MIPSREGISTERINFO_H
|
|
|
|
#define MIPSREGISTERINFO_H
|
|
|
|
|
2008-07-14 16:42:54 +02:00
|
|
|
#include "Mips.h"
|
2008-02-10 19:45:23 +01:00
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
2011-06-27 20:32:37 +02:00
|
|
|
|
|
|
|
#define GET_REGINFO_HEADER
|
|
|
|
#include "MipsGenRegisterInfo.inc"
|
2007-06-06 09:42:06 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
2008-07-14 16:42:54 +02:00
|
|
|
class MipsSubtarget;
|
2007-06-06 09:42:06 +02:00
|
|
|
class TargetInstrInfo;
|
|
|
|
class Type;
|
|
|
|
|
|
|
|
struct MipsRegisterInfo : public MipsGenRegisterInfo {
|
2008-07-14 16:42:54 +02:00
|
|
|
const MipsSubtarget &Subtarget;
|
2007-06-06 09:42:06 +02:00
|
|
|
const TargetInstrInfo &TII;
|
2011-03-04 18:51:39 +01:00
|
|
|
|
2008-07-14 16:42:54 +02:00
|
|
|
MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii);
|
2007-06-06 09:42:06 +02:00
|
|
|
|
2007-08-28 07:13:42 +02:00
|
|
|
/// getRegisterNumbering - Given the enum value for some register, e.g.
|
|
|
|
/// Mips::RA, return the number that it corresponds to (e.g. 31).
|
|
|
|
static unsigned getRegisterNumbering(unsigned RegEnum);
|
|
|
|
|
2008-07-14 16:42:54 +02:00
|
|
|
/// Get PIC indirect call register
|
2009-08-13 00:10:57 +02:00
|
|
|
static unsigned getPICCallReg();
|
2008-07-14 16:42:54 +02:00
|
|
|
|
2008-08-06 08:14:43 +02:00
|
|
|
/// Adjust the Mips stack frame.
|
|
|
|
void adjustMipsStackFrame(MachineFunction &MF) const;
|
|
|
|
|
2007-06-06 09:42:06 +02:00
|
|
|
/// Code Generation virtual methods...
|
2012-03-04 04:33:22 +01:00
|
|
|
const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
|
2012-03-01 23:27:29 +01:00
|
|
|
const uint32_t *getCallPreservedMask(CallingConv::ID) const;
|
2007-06-06 09:42:06 +02:00
|
|
|
|
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
|
|
|
|
2012-03-28 02:24:17 +02:00
|
|
|
virtual bool requiresRegisterScavenging(const MachineFunction &MF) const;
|
|
|
|
|
2012-04-23 23:39:35 +02:00
|
|
|
virtual bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const;
|
|
|
|
|
2007-06-06 09:42:06 +02:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2007-08-28 07:13:42 +02:00
|
|
|
/// Stack Frame Processing Methods
|
2010-08-27 01:32:16 +02:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|
|
|
int SPAdj, RegScavenger *RS = NULL) const;
|
2007-06-06 09:42:06 +02:00
|
|
|
|
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
|
|
|
|
2007-08-28 07:13:42 +02:00
|
|
|
/// Debug information queries.
|
2009-11-12 22:00:03 +01:00
|
|
|
unsigned getFrameRegister(const MachineFunction &MF) const;
|
2007-06-06 09:42:06 +02:00
|
|
|
|
2007-08-28 07:13:42 +02:00
|
|
|
/// Exception handling queries.
|
2007-06-06 09:42:06 +02:00
|
|
|
unsigned getEHExceptionRegister() const;
|
|
|
|
unsigned getEHHandlerRegister() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|