2009-07-02 22:18:33 +00:00
|
|
|
//===- Thumb1RegisterInfo.h - Thumb-1 Register Information Impl ----*- C++ -*-===//
|
2009-06-27 12:16:40 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2009-07-02 22:18:33 +00:00
|
|
|
// This file contains the Thumb-1 implementation of the TargetRegisterInfo class.
|
2009-06-27 12:16:40 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
#ifndef THUMB1REGISTERINFO_H
|
|
|
|
#define THUMB1REGISTERINFO_H
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
#include "ARM.h"
|
|
|
|
#include "ARMRegisterInfo.h"
|
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class ARMSubtarget;
|
2009-07-08 18:31:39 +00:00
|
|
|
class ARMBaseInstrInfo;
|
2009-06-27 12:16:40 +00:00
|
|
|
class Type;
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
struct Thumb1RegisterInfo : public ARMBaseRegisterInfo {
|
2009-06-27 12:16:40 +00:00
|
|
|
public:
|
2009-07-08 18:31:39 +00:00
|
|
|
Thumb1RegisterInfo(const ARMBaseInstrInfo &tii, const ARMSubtarget &STI);
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
/// emitLoadConstPool - Emits a load from constpool to materialize the
|
|
|
|
/// specified immediate.
|
2009-07-08 18:31:39 +00:00
|
|
|
void emitLoadConstPool(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator &MBBI,
|
2009-07-08 20:28:28 +00:00
|
|
|
DebugLoc dl,
|
2009-07-16 09:20:10 +00:00
|
|
|
unsigned DestReg, unsigned SubIdx, int Val,
|
2009-07-08 18:31:39 +00:00
|
|
|
ARMCC::CondCodes Pred = ARMCC::AL,
|
|
|
|
unsigned PredReg = 0) const;
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
/// Code Generation virtual methods...
|
|
|
|
const TargetRegisterClass *
|
|
|
|
getPhysicalRegisterRegClass(unsigned Reg, MVT VT = MVT::Other) const;
|
|
|
|
|
|
|
|
bool requiresRegisterScavenging(const MachineFunction &MF) const;
|
|
|
|
|
|
|
|
bool hasReservedCallFrame(MachineFunction &MF) const;
|
|
|
|
|
|
|
|
void eliminateCallFramePseudoInstr(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const;
|
|
|
|
|
2009-07-24 00:16:18 +00:00
|
|
|
// rewrite MI to access 'Offset' bytes from the FP. Return the offset that
|
|
|
|
// could not be handled directly in MI.
|
|
|
|
int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
|
|
|
|
unsigned FrameReg, int Offset) const;
|
2009-06-27 12:16:40 +00:00
|
|
|
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|
|
|
int SPAdj, RegScavenger *RS = NULL) const;
|
|
|
|
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
#endif // THUMB1REGISTERINFO_H
|