#include "VEInstrInfo.h"
#include "VE.h"
#include "VEMachineFunctionInfo.h"
#include "VESubtarget.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/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#define DEBUG_TYPE …
usingnamespacellvm;
#define GET_INSTRINFO_CTOR_DTOR
#include "VEGenInstrInfo.inc"
void VEInstrInfo::anchor() { … }
VEInstrInfo::VEInstrInfo(VESubtarget &ST)
: … { … }
static bool IsIntegerCC(unsigned CC) { … }
static VECC::CondCode GetOppositeBranchCondition(VECC::CondCode CC) { … }
static bool isUncondBranchOpcode(int Opc) { … }
static bool isCondBranchOpcode(int Opc) { … }
static bool isIndirectBranchOpcode(int Opc) { … }
static void parseCondBranch(MachineInstr *LastInst, MachineBasicBlock *&Target,
SmallVectorImpl<MachineOperand> &Cond) { … }
bool VEInstrInfo::analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const { … }
unsigned VEInstrInfo::insertBranch(MachineBasicBlock &MBB,
MachineBasicBlock *TBB,
MachineBasicBlock *FBB,
ArrayRef<MachineOperand> Cond,
const DebugLoc &DL, int *BytesAdded) const { … }
unsigned VEInstrInfo::removeBranch(MachineBasicBlock &MBB,
int *BytesRemoved) const { … }
bool VEInstrInfo::reverseBranchCondition(
SmallVectorImpl<MachineOperand> &Cond) const { … }
static bool IsAliasOfSX(Register Reg) { … }
static void copyPhysSubRegs(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, const DebugLoc &DL,
MCRegister DestReg, MCRegister SrcReg, bool KillSrc,
const MCInstrDesc &MCID, unsigned int NumSubRegs,
const unsigned *SubRegIdx,
const TargetRegisterInfo *TRI) { … }
void VEInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, const DebugLoc &DL,
MCRegister DestReg, MCRegister SrcReg,
bool KillSrc, bool RenamableDest,
bool RenamableSrc) const { … }
Register VEInstrInfo::isLoadFromStackSlot(const MachineInstr &MI,
int &FrameIndex) const { … }
Register VEInstrInfo::isStoreToStackSlot(const MachineInstr &MI,
int &FrameIndex) const { … }
void VEInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register SrcReg, bool isKill, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI,
Register VReg) const { … }
void VEInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register DestReg, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI,
Register VReg) const { … }
bool VEInstrInfo::foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
Register Reg, MachineRegisterInfo *MRI) const { … }
Register VEInstrInfo::getGlobalBaseReg(MachineFunction *MF) const { … }
static Register getVM512Upper(Register reg) { … }
static Register getVM512Lower(Register reg) { … }
static void expandPseudoLogM(MachineInstr &MI, const MCInstrDesc &MCID) { … }
static void addOperandsForVFMK(MachineInstrBuilder &MIB, MachineInstr &MI,
bool Upper) { … }
static void expandPseudoVFMK(const TargetInstrInfo &TI, MachineInstr &MI) { … }
bool VEInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { … }
bool VEInstrInfo::expandExtendStackPseudo(MachineInstr &MI) const { … }
bool VEInstrInfo::expandGetStackTopPseudo(MachineInstr &MI) const { … }