2009-11-07 22:00:39 +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-11-07 22:00:39 +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...
|
|
|
|
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,
|
2009-07-28 05:48:47 +00:00
|
|
|
unsigned FrameReg, int Offset,
|
2010-06-02 21:53:11 +00:00
|
|
|
unsigned MOVOpc, unsigned ADDriOpc,
|
|
|
|
unsigned SUBriOpc) const;
|
2009-07-26 18:55:14 +00:00
|
|
|
|
2009-10-05 22:30:23 +00:00
|
|
|
bool saveScavengerRegister(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I,
|
2009-10-19 22:27:30 +00:00
|
|
|
MachineBasicBlock::iterator &UseMI,
|
2009-10-05 22:30:23 +00:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
unsigned Reg) const;
|
2009-10-07 17:12:56 +00:00
|
|
|
unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
|
2010-03-09 21:45:49 +00:00
|
|
|
int SPAdj, FrameIndexValue *Value = NULL,
|
2009-10-07 17:12:56 +00:00
|
|
|
RegScavenger *RS = NULL) const;
|
2009-06-27 12:16:40 +00:00
|
|
|
|
|
|
|
void emitPrologue(MachineFunction &MF) const;
|
|
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2009-07-02 22:18:33 +00:00
|
|
|
#endif // THUMB1REGISTERINFO_H
|