2012-02-18 13:03:15 +01:00
|
|
|
//===-- XCoreRegisterInfo.h - XCore Register Information Impl ---*- C++ -*-===//
|
2008-11-07 11:59:00 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the XCore implementation of the MRegisterInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef XCOREREGISTERINFO_H
|
|
|
|
#define XCOREREGISTERINFO_H
|
|
|
|
|
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
2011-06-27 20:32:37 +02:00
|
|
|
|
|
|
|
#define GET_REGINFO_HEADER
|
|
|
|
#include "XCoreGenRegisterInfo.inc"
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class TargetInstrInfo;
|
|
|
|
|
|
|
|
struct XCoreRegisterInfo : public XCoreGenRegisterInfo {
|
|
|
|
private:
|
|
|
|
const TargetInstrInfo &TII;
|
|
|
|
|
|
|
|
void loadConstant(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I,
|
2009-02-13 03:29:03 +01:00
|
|
|
unsigned DstReg, int64_t Value, DebugLoc dl) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
void storeToStack(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I,
|
2009-02-13 03:29:03 +01:00
|
|
|
unsigned SrcReg, int Offset, DebugLoc dl) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
void loadFromStack(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I,
|
2009-02-13 03:29:03 +01:00
|
|
|
unsigned DstReg, int Offset, DebugLoc dl) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
XCoreRegisterInfo(const TargetInstrInfo &tii);
|
|
|
|
|
|
|
|
/// Code Generation virtual methods...
|
|
|
|
|
2012-03-04 04:33:22 +01:00
|
|
|
const uint16_t *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
BitVector getReservedRegs(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
bool requiresRegisterScavenging(const MachineFunction &MF) const;
|
2011-03-15 16:10:11 +01:00
|
|
|
|
2012-04-23 23:39:35 +02:00
|
|
|
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const;
|
|
|
|
|
2011-03-15 16:10:11 +01:00
|
|
|
bool useFPForScavengingIndex(const MachineFunction &MF) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2010-08-27 01:32:16 +02:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|
|
|
int SPAdj, RegScavenger *RS = NULL) const;
|
2009-11-12 22:00:03 +01:00
|
|
|
|
2008-11-07 11:59:00 +01:00
|
|
|
// Debug information queries.
|
2009-11-12 22:00:03 +01:00
|
|
|
unsigned getFrameRegister(const MachineFunction &MF) const;
|
2008-11-07 11:59:00 +01:00
|
|
|
|
|
|
|
//! Return whether to emit frame moves
|
|
|
|
static bool needsFrameMoves(const MachineFunction &MF);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|