LLVM  13.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::SystemZInstrInfo Class Reference

#include "Target/SystemZ/SystemZInstrInfo.h"

Inheritance diagram for llvm::SystemZInstrInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::SystemZInstrInfo:
Collaboration graph
[legend]

Public Member Functions

 SystemZInstrInfo (SystemZSubtarget &STI)
 
unsigned isLoadFromStackSlot (const MachineInstr &MI, int &FrameIndex) const override
 
unsigned isStoreToStackSlot (const MachineInstr &MI, int &FrameIndex) const override
 
bool isStackSlotCopy (const MachineInstr &MI, int &DestFrameIndex, int &SrcFrameIndex) const override
 
bool analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
 
unsigned removeBranch (MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
 
unsigned insertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
 
bool analyzeCompare (const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int &Mask, int &Value) const override
 
bool canInsertSelect (const MachineBasicBlock &, ArrayRef< MachineOperand > Cond, Register, Register, Register, int &, int &, int &) const override
 
void insertSelect (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, Register DstReg, ArrayRef< MachineOperand > Cond, Register TrueReg, Register FalseReg) const override
 
bool FoldImmediate (MachineInstr &UseMI, MachineInstr &DefMI, Register Reg, MachineRegisterInfo *MRI) const override
 
bool isPredicable (const MachineInstr &MI) const override
 
bool isProfitableToIfCvt (MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, BranchProbability Probability) const override
 
bool isProfitableToIfCvt (MachineBasicBlock &TMBB, unsigned NumCyclesT, unsigned ExtraPredCyclesT, MachineBasicBlock &FMBB, unsigned NumCyclesF, unsigned ExtraPredCyclesF, BranchProbability Probability) const override
 
bool isProfitableToDupForIfCvt (MachineBasicBlock &MBB, unsigned NumCycles, BranchProbability Probability) const override
 
bool PredicateInstruction (MachineInstr &MI, ArrayRef< MachineOperand > Pred) const override
 
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
 
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
 
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIdx, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
 
MachineInstrconvertToThreeAddress (MachineFunction::iterator &MFI, MachineInstr &MI, LiveVariables *LV) const override
 
MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, int FrameIndex, LiveIntervals *LIS=nullptr, VirtRegMap *VRM=nullptr) const override
 
MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr &MI, ArrayRef< unsigned > Ops, MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI, LiveIntervals *LIS=nullptr) const override
 
bool expandPostRAPseudo (MachineInstr &MBBI) const override
 
bool reverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const override
 
const SystemZRegisterInfogetRegisterInfo () const
 
unsigned getInstSizeInBytes (const MachineInstr &MI) const override
 
SystemZII::Branch getBranchInfo (const MachineInstr &MI) const
 
void getLoadStoreOpcodes (const TargetRegisterClass *RC, unsigned &LoadOpcode, unsigned &StoreOpcode) const
 
unsigned getOpcodeForOffset (unsigned Opcode, int64_t Offset) const
 
unsigned getLoadAndTest (unsigned Opcode) const
 
bool isRxSBGMask (uint64_t Mask, unsigned BitSize, unsigned &Start, unsigned &End) const
 
unsigned getFusedCompare (unsigned Opcode, SystemZII::FusedCompareType Type, const MachineInstr *MI=nullptr) const
 
bool prepareCompareSwapOperands (MachineBasicBlock::iterator MBBI) const
 
unsigned getLoadAndTrap (unsigned Opcode) const
 
void loadImmediate (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned Reg, uint64_t Value) const
 
bool verifyInstruction (const MachineInstr &MI, StringRef &ErrInfo) const override
 
bool areMemAccessesTriviallyDisjoint (const MachineInstr &MIa, const MachineInstr &MIb) const override
 

Protected Member Functions

MachineInstrcommuteInstructionImpl (MachineInstr &MI, bool NewMI, unsigned CommuteOpIdx1, unsigned CommuteOpIdx2) const override
 Commutes the operands in the given instruction by changing the operands order and/or changing the instruction's opcode and/or the immediate value operand. More...
 

Detailed Description

Definition at line 174 of file SystemZInstrInfo.h.

Constructor & Destructor Documentation

◆ SystemZInstrInfo()

SystemZInstrInfo::SystemZInstrInfo ( SystemZSubtarget STI)
explicit

Definition at line 58 of file SystemZInstrInfo.cpp.

Member Function Documentation

◆ analyzeBranch()

bool SystemZInstrInfo::analyzeBranch ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const
override

◆ analyzeCompare()

bool SystemZInstrInfo::analyzeCompare ( const MachineInstr MI,
Register SrcReg,
Register SrcReg2,
int Mask,
int Value 
) const
override

Definition at line 516 of file SystemZInstrInfo.cpp.

References assert(), llvm::BitmaskEnumDetail::Mask(), and MI.

◆ areMemAccessesTriviallyDisjoint()

bool SystemZInstrInfo::areMemAccessesTriviallyDisjoint ( const MachineInstr MIa,
const MachineInstr MIb 
) const
override

◆ canInsertSelect()

bool SystemZInstrInfo::canInsertSelect ( const MachineBasicBlock MBB,
ArrayRef< MachineOperand Cond,
Register  DstReg,
Register  TrueReg,
Register  FalseReg,
int CondCycles,
int TrueCycles,
int FalseCycles 
) const
override

◆ commuteInstructionImpl()

MachineInstr * SystemZInstrInfo::commuteInstructionImpl ( MachineInstr MI,
bool  NewMI,
unsigned  CommuteOpIdx1,
unsigned  CommuteOpIdx2 
) const
overrideprotected

Commutes the operands in the given instruction by changing the operands order and/or changing the instruction's opcode and/or the immediate value operand.

The arguments 'CommuteOpIdx1' and 'CommuteOpIdx2' specify the operands to be commuted.

Do not call this method for a non-commutable instruction or non-commutable operands. Even though the instruction is commutable, the method may still fail to commute the operands, null pointer is returned in such cases.

Definition at line 272 of file SystemZInstrInfo.cpp.

References llvm::TargetInstrInfo::commuteInstructionImpl(), and MI.

◆ convertToThreeAddress()

MachineInstr * SystemZInstrInfo::convertToThreeAddress ( MachineFunction::iterator MFI,
MachineInstr MI,
LiveVariables LV 
) const
override

Definition at line 945 of file SystemZInstrInfo.cpp.

References allOnes(), llvm::And, interpretAndImmediate(), MBB, and MI.

◆ copyPhysReg()

void SystemZInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
const DebugLoc DL,
MCRegister  DestReg,
MCRegister  SrcReg,
bool  KillSrc 
) const
override

◆ expandPostRAPseudo()

bool SystemZInstrInfo::expandPostRAPseudo ( MachineInstr MBBI) const
override

◆ FoldImmediate()

bool SystemZInstrInfo::FoldImmediate ( MachineInstr UseMI,
MachineInstr DefMI,
Register  Reg,
MachineRegisterInfo MRI 
) const
override

◆ foldMemoryOperandImpl() [1/2]

MachineInstr * SystemZInstrInfo::foldMemoryOperandImpl ( MachineFunction MF,
MachineInstr MI,
ArrayRef< unsigned >  Ops,
MachineBasicBlock::iterator  InsertPt,
int  FrameIndex,
LiveIntervals LIS = nullptr,
VirtRegMap VRM = nullptr 
) const
override

Definition at line 994 of file SystemZInstrInfo.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addReg(), llvm::MachineInstr::addRegisterDead(), assert(), llvm::BuildMI(), contains(), llvm::LiveRange::createDeadDef(), llvm::MachineInstr::definesRegister(), E, llvm::MachineInstr::findRegisterDefOperand(), llvm::ISD::FrameIndex, llvm::MCRegister::from(), get, llvm::SystemZII::getAccessSize(), llvm::MachineFunction::getFrameInfo(), llvm::SlotIndexes::getInstructionIndex(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineFrameInfo::getObjectSize(), llvm::VirtRegMap::getPhys(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::SlotIndex::getRegSlot(), llvm::LiveIntervals::getRegUnit(), llvm::MachineMemOperand::getSize(), llvm::LiveIntervals::getSlotIndexes(), llvm::MachineFunction::getSubtarget(), llvm::SystemZ::getTargetMemOpcode(), llvm::LiveIntervals::getVNInfoAllocator(), llvm::SystemZII::HasIndex, I, llvm::MachineMemOperand::isAtomic(), llvm::isInt< 8 >(), isSimpleBD12Move(), llvm::isUInt< 16 >(), llvm::MCRegisterInfo::DiffListIterator::isValid(), llvm::Register::isVirtualRegister(), llvm::MachineMemOperand::isVolatile(), llvm::ARM_MB::LD, llvm::LiveRange::liveAt(), MI, MRI, llvm::SystemZISD::MVC, llvm::MachineInstr::NoFPExcept, llvm::MachineInstr::NoSWrap, Offset, llvm::MCOI::OPERAND_REGISTER, llvm::MachineInstr::operands(), llvm::MCOperandInfo::OperandType, llvm::MCInstrDesc::OpInfo, prepareCompareSwapOperands(), Reg, llvm::MCOperandInfo::RegClass, llvm::MachineOperand::setIsDead(), llvm::MachineRegisterInfo::setRegClass(), llvm::SystemZII::SimpleBDXLoad, llvm::SystemZII::SimpleBDXStore, llvm::Check::Size, llvm::ArrayRef< T >::size(), llvm::AArch64ISD::STG, transferDeadCC(), transferMIFlag(), TRI, and llvm::MCInstrDesc::TSFlags.

◆ foldMemoryOperandImpl() [2/2]

MachineInstr * SystemZInstrInfo::foldMemoryOperandImpl ( MachineFunction MF,
MachineInstr MI,
ArrayRef< unsigned >  Ops,
MachineBasicBlock::iterator  InsertPt,
MachineInstr LoadMI,
LiveIntervals LIS = nullptr 
) const
override

Definition at line 1326 of file SystemZInstrInfo.cpp.

◆ getBranchInfo()

SystemZII::Branch SystemZInstrInfo::getBranchInfo ( const MachineInstr MI) const

◆ getFusedCompare()

unsigned SystemZInstrInfo::getFusedCompare ( unsigned  Opcode,
SystemZII::FusedCompareType  Type,
const MachineInstr MI = nullptr 
) const

◆ getInstSizeInBytes()

unsigned SystemZInstrInfo::getInstSizeInBytes ( const MachineInstr MI) const
override

◆ getLoadAndTest()

unsigned SystemZInstrInfo::getLoadAndTest ( unsigned  Opcode) const

Definition at line 1644 of file SystemZInstrInfo.cpp.

References llvm::MipsISD::LDR, and llvm::AArch64CC::LT.

◆ getLoadAndTrap()

unsigned SystemZInstrInfo::getLoadAndTrap ( unsigned  Opcode) const

Definition at line 1903 of file SystemZInstrInfo.cpp.

References llvm::SystemZSubtarget::hasLoadAndTrap().

◆ getLoadStoreOpcodes()

void SystemZInstrInfo::getLoadStoreOpcodes ( const TargetRegisterClass RC,
unsigned &  LoadOpcode,
unsigned &  StoreOpcode 
) const

◆ getOpcodeForOffset()

unsigned SystemZInstrInfo::getOpcodeForOffset ( unsigned  Opcode,
int64_t  Offset 
) const

◆ getRegisterInfo()

const SystemZRegisterInfo& llvm::SystemZInstrInfo::getRegisterInfo ( ) const
inline

Definition at line 291 of file SystemZInstrInfo.h.

Referenced by llvm::SystemZSubtarget::getRegisterInfo().

◆ insertBranch()

unsigned SystemZInstrInfo::insertBranch ( MachineBasicBlock MBB,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
ArrayRef< MachineOperand Cond,
const DebugLoc DL,
int BytesAdded = nullptr 
) const
override

◆ insertSelect()

void SystemZInstrInfo::insertSelect ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL,
Register  DstReg,
ArrayRef< MachineOperand Cond,
Register  TrueReg,
Register  FalseReg 
) const
override

◆ isLoadFromStackSlot()

unsigned SystemZInstrInfo::isLoadFromStackSlot ( const MachineInstr MI,
int FrameIndex 
) const
override

◆ isPredicable()

bool SystemZInstrInfo::isPredicable ( const MachineInstr MI) const
override

Definition at line 673 of file SystemZInstrInfo.cpp.

References MI.

◆ isProfitableToDupForIfCvt()

bool SystemZInstrInfo::isProfitableToDupForIfCvt ( MachineBasicBlock MBB,
unsigned  NumCycles,
BranchProbability  Probability 
) const
override

Definition at line 713 of file SystemZInstrInfo.cpp.

◆ isProfitableToIfCvt() [1/2]

bool SystemZInstrInfo::isProfitableToIfCvt ( MachineBasicBlock MBB,
unsigned  NumCycles,
unsigned  ExtraPredCycles,
BranchProbability  Probability 
) const
override

◆ isProfitableToIfCvt() [2/2]

bool SystemZInstrInfo::isProfitableToIfCvt ( MachineBasicBlock TMBB,
unsigned  NumCyclesT,
unsigned  ExtraPredCyclesT,
MachineBasicBlock FMBB,
unsigned  NumCyclesF,
unsigned  ExtraPredCyclesF,
BranchProbability  Probability 
) const
override

Definition at line 703 of file SystemZInstrInfo.cpp.

◆ isRxSBGMask()

bool SystemZInstrInfo::isRxSBGMask ( uint64_t  Mask,
unsigned  BitSize,
unsigned &  Start,
unsigned &  End 
) const

Definition at line 1685 of file SystemZInstrInfo.cpp.

◆ isStackSlotCopy()

bool SystemZInstrInfo::isStackSlotCopy ( const MachineInstr MI,
int DestFrameIndex,
int SrcFrameIndex 
) const
override

◆ isStoreToStackSlot()

unsigned SystemZInstrInfo::isStoreToStackSlot ( const MachineInstr MI,
int FrameIndex 
) const
override

◆ loadImmediate()

void SystemZInstrInfo::loadImmediate ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
unsigned  Reg,
uint64_t  Value 
) const

◆ loadRegFromStackSlot()

void SystemZInstrInfo::loadRegFromStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
Register  DestReg,
int  FrameIdx,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const
override

◆ PredicateInstruction()

bool SystemZInstrInfo::PredicateInstruction ( MachineInstr MI,
ArrayRef< MachineOperand Pred 
) const
override

◆ prepareCompareSwapOperands()

bool SystemZInstrInfo::prepareCompareSwapOperands ( MachineBasicBlock::iterator  MBBI) const

◆ removeBranch()

unsigned SystemZInstrInfo::removeBranch ( MachineBasicBlock MBB,
int BytesRemoved = nullptr 
) const
override

◆ reverseBranchCondition()

bool SystemZInstrInfo::reverseBranchCondition ( SmallVectorImpl< MachineOperand > &  Cond) const
override

Definition at line 471 of file SystemZInstrInfo.cpp.

References assert(), and Cond.

◆ storeRegToStackSlot()

void SystemZInstrInfo::storeRegToStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
Register  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const
override

◆ verifyInstruction()

bool SystemZInstrInfo::verifyInstruction ( const MachineInstr MI,
StringRef ErrInfo 
) const
override

The documentation for this class was generated from the following files: