#include "SparcInstrInfo.h"
#include "Sparc.h"
#include "SparcMachineFunctionInfo.h"
#include "SparcSubtarget.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/ErrorHandling.h"
usingnamespacellvm;
#define GET_INSTRINFO_CTOR_DTOR
#include "SparcGenInstrInfo.inc"
static cl::opt<unsigned> BPccDisplacementBits(
"sparc-bpcc-offset-bits", cl::Hidden, cl::init(19),
cl::desc("Restrict range of BPcc/FBPfcc instructions (DEBUG)"));
static cl::opt<unsigned>
BPrDisplacementBits("sparc-bpr-offset-bits", cl::Hidden, cl::init(16),
cl::desc("Restrict range of BPr instructions (DEBUG)"));
void SparcInstrInfo::anchor() { … }
SparcInstrInfo::SparcInstrInfo(SparcSubtarget &ST)
: … { … }
Register SparcInstrInfo::isLoadFromStackSlot(const MachineInstr &MI,
int &FrameIndex) const { … }
Register SparcInstrInfo::isStoreToStackSlot(const MachineInstr &MI,
int &FrameIndex) const { … }
static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC)
{ … }
static bool isUncondBranchOpcode(int Opc) { … }
static bool isI32CondBranchOpcode(int Opc) { … }
static bool isI64CondBranchOpcode(int Opc) { … }
static bool isRegCondBranchOpcode(int Opc) { … }
static bool isFCondBranchOpcode(int Opc) { … }
static bool isCondBranchOpcode(int Opc) { … }
static bool isIndirectBranchOpcode(int Opc) { … }
static void parseCondBranch(MachineInstr *LastInst, MachineBasicBlock *&Target,
SmallVectorImpl<MachineOperand> &Cond) { … }
MachineBasicBlock *
SparcInstrInfo::getBranchDestBlock(const MachineInstr &MI) const { … }
bool SparcInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const { … }
unsigned SparcInstrInfo::insertBranch(MachineBasicBlock &MBB,
MachineBasicBlock *TBB,
MachineBasicBlock *FBB,
ArrayRef<MachineOperand> Cond,
const DebugLoc &DL,
int *BytesAdded) const { … }
unsigned SparcInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const { … }
bool SparcInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const { … }
bool SparcInstrInfo::isBranchOffsetInRange(unsigned BranchOpc,
int64_t Offset) const { … }
void SparcInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
const DebugLoc &DL, MCRegister DestReg,
MCRegister SrcReg, bool KillSrc,
bool RenamableDest, bool RenamableSrc) const { … }
void SparcInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register SrcReg, bool isKill, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI,
Register VReg) const { … }
void SparcInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register DestReg, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI,
Register VReg) const { … }
Register SparcInstrInfo::getGlobalBaseReg(MachineFunction *MF) const { … }
unsigned SparcInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { … }
bool SparcInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { … }