LLVM API Documentation

Defines | Functions
AArch64InstrInfo.cpp File Reference
#include "AArch64InstrInfo.h"
#include "AArch64Subtarget.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "AArch64MachineCombinerPattern.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TargetRegistry.h"
#include "AArch64GenInstrInfo.inc"
Include dependency graph for AArch64InstrInfo.cpp:

Go to the source code of this file.

Defines

#define GET_INSTRINFO_CTOR_DTOR

Functions

static void parseCondBranch (MachineInstr *LastInst, MachineBasicBlock *&Target, SmallVectorImpl< MachineOperand > &Cond)
static unsigned removeCopies (const MachineRegisterInfo &MRI, unsigned VReg)
static unsigned canFoldIntoCSel (const MachineRegisterInfo &MRI, unsigned VReg, unsigned *NewVReg=nullptr)
static bool UpdateOperandRegClass (MachineInstr *Instr)
static unsigned convertFlagSettingOpcode (MachineInstr *MI)
static const MachineInstrBuilderAddSubReg (const MachineInstrBuilder &MIB, unsigned Reg, unsigned SubIdx, unsigned State, const TargetRegisterInfo *TRI)
static bool forwardCopyWillClobberTuple (unsigned DestReg, unsigned SrcReg, unsigned NumRegs)
static bool isCombineInstrSettingFlag (unsigned Opc)
static bool isCombineInstrCandidate32 (unsigned Opc)
static bool isCombineInstrCandidate64 (unsigned Opc)
static bool isCombineInstrCandidate (unsigned Opc)
static bool canCombineWithMUL (MachineBasicBlock &MBB, MachineOperand &MO, unsigned MulOpc, unsigned ZeroReg)
static MachineInstrgenMadd (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, const TargetRegisterClass *RC)
static MachineInstrgenMaddR (MachineFunction &MF, MachineRegisterInfo &MRI, const TargetInstrInfo *TII, MachineInstr &Root, SmallVectorImpl< MachineInstr * > &InsInstrs, unsigned IdxMulOpd, unsigned MaddOpc, unsigned VR, const TargetRegisterClass *RC)

Define Documentation

Definition at line 29 of file AArch64InstrInfo.cpp.


Function Documentation

static const MachineInstrBuilder& AddSubReg ( const MachineInstrBuilder MIB,
unsigned  Reg,
unsigned  SubIdx,
unsigned  State,
const TargetRegisterInfo TRI 
) [static]
static bool canCombineWithMUL ( MachineBasicBlock MBB,
MachineOperand MO,
unsigned  MulOpc,
unsigned  ZeroReg 
) [static]
static unsigned canFoldIntoCSel ( const MachineRegisterInfo MRI,
unsigned  VReg,
unsigned NewVReg = nullptr 
) [static]
static unsigned convertFlagSettingOpcode ( MachineInstr MI) [static]

convertFlagSettingOpcode - return opcode that does not set flags when possible. The caller is responsible to do the actual substitution and legality checking.

Definition at line 746 of file AArch64InstrInfo.cpp.

References llvm::MachineInstr::getOpcode().

Referenced by llvm::AArch64InstrInfo::hasPattern(), and llvm::AArch64InstrInfo::optimizeCompareInstr().

static bool forwardCopyWillClobberTuple ( unsigned  DestReg,
unsigned  SrcReg,
unsigned  NumRegs 
) [static]

Definition at line 1472 of file AArch64InstrInfo.cpp.

Referenced by llvm::AArch64InstrInfo::copyPhysRegTuple().

static MachineInstr* genMadd ( MachineFunction MF,
MachineRegisterInfo MRI,
const TargetInstrInfo TII,
MachineInstr Root,
SmallVectorImpl< MachineInstr * > &  InsInstrs,
unsigned  IdxMulOpd,
unsigned  MaddOpc,
const TargetRegisterClass RC 
) [static]

genMadd - Generate madd instruction and combine mul and add. Example: MUL I=A,B,0 ADD R,I,C ==> MADD R,A,B,C

Parameters:
Rootis the ADD instruction
[out]InsInstrsis a vector of machine instructions and will contain the generated madd instruction
IdxMulOpdis index of operand in Root that is the result of the MUL. In the example above IdxMulOpd is 1.
MaddOpcthe opcode fo the madd instruction

Definition at line 2558 of file AArch64InstrInfo.cpp.

References llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MCInstrInfo::get(), llvm::MachineInstr::getDebugLoc(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineOperand::isKill(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::ISD::MUL, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::AArch64InstrInfo::genAlternativeCodeSequence().

static MachineInstr* genMaddR ( MachineFunction MF,
MachineRegisterInfo MRI,
const TargetInstrInfo TII,
MachineInstr Root,
SmallVectorImpl< MachineInstr * > &  InsInstrs,
unsigned  IdxMulOpd,
unsigned  MaddOpc,
unsigned  VR,
const TargetRegisterClass RC 
) [static]

genMaddR - Generate madd instruction and combine mul and add using an extra virtual register Example - an ADD intermediate needs to be stored in a register: MUL I=A,B,0 ADD R,I,Imm ==> ORR V, ZR, Imm ==> MADD R,A,B,V

Parameters:
Rootis the ADD instruction
[out]InsInstrsis a vector of machine instructions and will contain the generated madd instruction
IdxMulOpdis index of operand in Root that is the result of the MUL. In the example above IdxMulOpd is 1.
MaddOpcthe opcode fo the madd instruction
VRis a virtual register that holds the value of an ADD operand (V in the example above).

Definition at line 2609 of file AArch64InstrInfo.cpp.

References llvm::BuildMI(), llvm::MachineRegisterInfo::constrainRegClass(), llvm::MCInstrInfo::get(), llvm::MachineInstr::getDebugLoc(), llvm::getKillRegState(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineOperand::isKill(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::ISD::MUL, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::AArch64InstrInfo::genAlternativeCodeSequence().

static bool isCombineInstrCandidate ( unsigned  Opc) [static]
static bool isCombineInstrCandidate32 ( unsigned  Opc) [static]

Definition at line 2366 of file AArch64InstrInfo.cpp.

Referenced by isCombineInstrCandidate().

static bool isCombineInstrCandidate64 ( unsigned  Opc) [static]

Definition at line 2385 of file AArch64InstrInfo.cpp.

Referenced by isCombineInstrCandidate().

static bool isCombineInstrSettingFlag ( unsigned  Opc) [static]

Definition at line 2347 of file AArch64InstrInfo.cpp.

Referenced by llvm::AArch64InstrInfo::hasPattern().

static void parseCondBranch ( MachineInstr LastInst,
MachineBasicBlock *&  Target,
SmallVectorImpl< MachineOperand > &  Cond 
) [static]
static unsigned removeCopies ( const MachineRegisterInfo MRI,
unsigned  VReg 
) [static]
static bool UpdateOperandRegClass ( MachineInstr Instr) [static]