2007-06-06 09:42:06 +02:00
|
|
|
//===- MipsRegisterInfo.h - Mips Register Information Impl ------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// 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
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
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
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#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"
|
2007-06-06 09:42:06 +02:00
|
|
|
#include "MipsGenRegisterInfo.h.inc"
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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...
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
llvm-svn: 40033
2007-07-19 03:14:50 +02:00
|
|
|
const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
|
2007-06-06 09:42:06 +02:00
|
|
|
|
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
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.
|
2007-06-06 09:42:06 +02:00
|
|
|
unsigned getRARegister() const;
|
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;
|
2007-11-11 20:50:10 +01:00
|
|
|
|
2007-11-13 20:13:01 +01:00
|
|
|
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
|
2007-06-06 09:42:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|