2006-02-05 05:50:24 +00:00
|
|
|
//===- SparcRegisterInfo.h - Sparc Register Information Impl ----*- C++ -*-===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-02-25 19:28:19 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2006-02-05 05:50:24 +00:00
|
|
|
// This file contains the Sparc implementation of the MRegisterInfo class.
|
2004-02-25 19:28:19 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
#ifndef SPARCREGISTERINFO_H
|
|
|
|
#define SPARCREGISTERINFO_H
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
#include "llvm/Target/MRegisterInfo.h"
|
2006-02-05 05:50:24 +00:00
|
|
|
#include "SparcGenRegisterInfo.h.inc"
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
class SparcSubtarget;
|
2006-11-27 23:37:22 +00:00
|
|
|
class TargetInstrInfo;
|
2004-02-25 19:28:19 +00:00
|
|
|
class Type;
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
struct SparcRegisterInfo : public SparcGenRegisterInfo {
|
|
|
|
SparcSubtarget &Subtarget;
|
2006-11-13 23:36:35 +00:00
|
|
|
const TargetInstrInfo &TII;
|
2006-02-04 06:58:46 +00:00
|
|
|
|
2006-11-13 23:36:35 +00:00
|
|
|
SparcRegisterInfo(SparcSubtarget &st, const TargetInstrInfo &tii);
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
/// Code Generation virtual methods...
|
2004-08-15 22:15:11 +00:00
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
2004-02-25 19:28:19 +00:00
|
|
|
MachineBasicBlock::iterator MBBI,
|
2007-12-05 03:14:33 +00:00
|
|
|
unsigned SrcReg, bool isKill, int FrameIndex,
|
2005-09-30 01:29:42 +00:00
|
|
|
const TargetRegisterClass *RC) const;
|
2004-08-15 22:15:11 +00:00
|
|
|
|
2007-12-05 03:14:33 +00:00
|
|
|
void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
2007-10-18 22:40:57 +00:00
|
|
|
SmallVectorImpl<MachineOperand> &Addr,
|
2007-10-05 01:32:41 +00:00
|
|
|
const TargetRegisterClass *RC,
|
2007-10-18 21:29:24 +00:00
|
|
|
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
2007-10-05 01:32:41 +00:00
|
|
|
|
2004-08-15 22:15:11 +00:00
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
2005-09-30 01:29:42 +00:00
|
|
|
unsigned DestReg, int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC) const;
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2007-10-05 01:32:41 +00:00
|
|
|
void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
2007-10-18 22:40:57 +00:00
|
|
|
SmallVectorImpl<MachineOperand> &Addr,
|
2007-10-05 01:32:41 +00:00
|
|
|
const TargetRegisterClass *RC,
|
2007-10-18 21:29:24 +00:00
|
|
|
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
2007-10-05 01:32:41 +00:00
|
|
|
|
2004-08-15 22:15:11 +00:00
|
|
|
void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
2007-09-26 06:25:56 +00:00
|
|
|
const TargetRegisterClass *DestRC,
|
|
|
|
const TargetRegisterClass *SrcRC) const;
|
2006-02-03 07:06:25 +00:00
|
|
|
|
2007-03-20 08:09:38 +00:00
|
|
|
void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
|
|
|
|
unsigned DestReg, const MachineInstr *Orig) const;
|
|
|
|
|
2006-02-03 07:06:25 +00:00
|
|
|
virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
|
2007-12-02 08:30:39 +00:00
|
|
|
SmallVectorImpl<unsigned> &Ops,
|
2006-02-03 07:06:25 +00:00
|
|
|
int FrameIndex) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
|
2007-12-01 02:07:52 +00:00
|
|
|
virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
|
2007-12-02 08:30:39 +00:00
|
|
|
SmallVectorImpl<unsigned> &Ops,
|
2007-12-01 02:07:52 +00:00
|
|
|
MachineInstr* LoadMI) const {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-07-14 14:06:15 +00:00
|
|
|
const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
2006-05-18 00:12:58 +00:00
|
|
|
|
2007-07-14 14:06:15 +00:00
|
|
|
const TargetRegisterClass* const* getCalleeSavedRegClasses(
|
|
|
|
const MachineFunction *MF = 0) const;
|
2006-05-18 00:12:58 +00:00
|
|
|
|
2007-02-19 21:49:54 +00:00
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
|
|
|
|
2007-01-23 00:57:47 +00:00
|
|
|
bool hasFP(const MachineFunction &MF) const;
|
|
|
|
|
2004-02-25 19:28:19 +00:00
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2007-02-28 00:21:17 +00:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
2007-05-01 09:13:03 +00:00
|
|
|
int SPAdj, RegScavenger *RS = NULL) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
|
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
|
|
|
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2006-03-23 18:12:57 +00:00
|
|
|
|
2006-03-28 13:48:33 +00:00
|
|
|
// Debug information queries.
|
2006-04-07 16:34:46 +00:00
|
|
|
unsigned getRARegister() const;
|
2006-03-28 13:48:33 +00:00
|
|
|
unsigned getFrameRegister(MachineFunction &MF) const;
|
2007-02-21 22:54:50 +00:00
|
|
|
|
|
|
|
// Exception handling queries.
|
|
|
|
unsigned getEHExceptionRegister() const;
|
|
|
|
unsigned getEHHandlerRegister() const;
|
2007-11-11 19:50:10 +00:00
|
|
|
|
2007-11-13 19:13:01 +00:00
|
|
|
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
|
2004-02-25 19:28:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|