Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::SystemZInstrInfo Class Reference

#include "Target/SystemZ/SystemZInstrInfo.h"

Inheritance diagram for llvm::SystemZInstrInfo:
[legend]

Public Member Functions

 SystemZInstrInfo (const SystemZSubtarget &STI)
Register isLoadFromStackSlot (const MachineInstr &MI, int &FrameIndex) const override
Register isStoreToStackSlot (const MachineInstr &MI, int &FrameIndex) const override
Register isLoadFromStackSlotPostFE (const MachineInstr &MI, int &FrameIndex) const override
Register isStoreToStackSlotPostFE (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, int64_t &Mask, int64_t &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, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIdx, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
MachineInstrconvertToThreeAddress (MachineInstr &MI, LiveVariables *LV, LiveIntervals *LIS) const override
bool useMachineCombiner () const override
bool isAssociativeAndCommutative (const MachineInstr &Inst, bool Invert) const override
std::optional< unsignedgetInverseOpcode (unsigned Opcode) 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 MachineInstr *MI=nullptr) const
bool hasDisplacementPairInsn (unsigned Opcode) 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
bool getConstValDefinedInReg (const MachineInstr &MI, const Register Reg, int64_t &ImmVal) const override
std::optional< DestSourcePairisCopyInstrImpl (const MachineInstr &MI) 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.

Detailed Description

Definition at line 185 of file SystemZInstrInfo.h.

Constructor & Destructor Documentation

◆ SystemZInstrInfo()

SystemZInstrInfo::SystemZInstrInfo ( const SystemZSubtarget & STI)
explicit

Definition at line 62 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,
int64_t & Mask,
int64_t & Value ) const
override

Definition at line 581 of file SystemZInstrInfo.cpp.

References assert(), and MI.

◆ areMemAccessesTriviallyDisjoint()

◆ canInsertSelect()

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

Definition at line 598 of file SystemZInstrInfo.cpp.

References MBB, and MRI.

◆ 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 292 of file SystemZInstrInfo.cpp.

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

◆ convertToThreeAddress()

◆ copyPhysReg()

◆ expandPostRAPseudo()

bool SystemZInstrInfo::expandPostRAPseudo ( MachineInstr & MBBI) const
override

Definition at line 1636 of file SystemZInstrInfo.cpp.

References llvm::get(), llvm::SystemZ::isHighReg(), and MI.

◆ 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 1221 of file SystemZInstrInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, AbstractManglingParser< Derived, Alloc >::Ops, 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(), llvm::MachineInstr::findRegisterDefOperand(), llvm::MCRegister::from(), llvm::get(), llvm::SystemZII::getAccessSize(), llvm::MachineFunction::getFrameInfo(), llvm::SlotIndexes::getInstructionIndex(), llvm::MachineFrameInfo::getObjectSize(), llvm::VirtRegMap::getPhys(), getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), 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(), isSimpleBD12Move(), llvm::isUInt(), llvm::Register::isVirtual(), llvm::MachineMemOperand::isVolatile(), llvm::LiveRange::liveAt(), MI, MRI, llvm::MachineInstr::NoFPExcept, llvm::MachineInstr::NoSWrap, llvm::Offset, llvm::MCOI::OPERAND_REGISTER, llvm::MachineInstr::operands(), prepareCompareSwapOperands(), llvm::range_size(), Register, llvm::MachineOperand::setIsDead(), llvm::SystemZII::SimpleBDXLoad, llvm::SystemZII::SimpleBDXStore, Size, transferDeadCC(), transferMIFlag(), TRI, and llvm::MCInstrDesc::TSFlags.

◆ foldMemoryOperandImpl() [2/2]

◆ getBranchInfo()

◆ getConstValDefinedInReg()

bool SystemZInstrInfo::getConstValDefinedInReg ( const MachineInstr & MI,
const Register Reg,
int64_t & ImmVal ) const
override

Definition at line 2340 of file SystemZInstrInfo.cpp.

References MI.

◆ getFusedCompare()

◆ getInstSizeInBytes()

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

◆ getInverseOpcode()

std::optional< unsigned > SystemZInstrInfo::getInverseOpcode ( unsigned Opcode) const
override

Definition at line 1192 of file SystemZInstrInfo.cpp.

Referenced by isAssociativeAndCommutative().

◆ getLoadAndTest()

unsigned SystemZInstrInfo::getLoadAndTest ( unsigned Opcode) const

Definition at line 1991 of file SystemZInstrInfo.cpp.

◆ getLoadAndTrap()

unsigned SystemZInstrInfo::getLoadAndTrap ( unsigned Opcode) const

Definition at line 2232 of file SystemZInstrInfo.cpp.

◆ getLoadStoreOpcodes()

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

Definition at line 1888 of file SystemZInstrInfo.cpp.

References llvm_unreachable.

Referenced by loadRegFromStackSlot(), and storeRegToStackSlot().

◆ getOpcodeForOffset()

unsigned SystemZInstrInfo::getOpcodeForOffset ( unsigned Opcode,
int64_t Offset,
const MachineInstr * MI = nullptr ) const

◆ getRegisterInfo()

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

Definition at line 314 of file SystemZInstrInfo.h.

◆ hasDisplacementPairInsn()

bool SystemZInstrInfo::hasDisplacementPairInsn ( unsigned Opcode) const

Definition at line 1984 of file SystemZInstrInfo.cpp.

References llvm::get(), and llvm::SystemZII::Has20BitOffset.

◆ 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

◆ isAssociativeAndCommutative()

bool SystemZInstrInfo::isAssociativeAndCommutative ( const MachineInstr & Inst,
bool Invert ) const
override

◆ isCopyInstrImpl()

std::optional< DestSourcePair > SystemZInstrInfo::isCopyInstrImpl ( const MachineInstr & MI) const
override

Definition at line 2354 of file SystemZInstrInfo.cpp.

References MI.

◆ isLoadFromStackSlot()

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

Definition at line 340 of file SystemZInstrInfo.cpp.

References isSimpleMove(), MI, and llvm::SystemZII::SimpleBDXLoad.

◆ isLoadFromStackSlotPostFE()

Register SystemZInstrInfo::isLoadFromStackSlotPostFE ( const MachineInstr & MI,
int & FrameIndex ) const
override

Definition at line 350 of file SystemZInstrInfo.cpp.

References Accesses, assert(), llvm::cast(), MI, and llvm::SystemZII::SimpleBDXLoad.

◆ isPredicable()

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

Definition at line 780 of file SystemZInstrInfo.cpp.

References MI.

◆ isProfitableToDupForIfCvt()

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

Definition at line 820 of file SystemZInstrInfo.cpp.

References MBB.

◆ isProfitableToIfCvt() [1/2]

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

Definition at line 791 of file SystemZInstrInfo.cpp.

References MBB.

◆ 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 810 of file SystemZInstrInfo.cpp.

◆ isRxSBGMask()

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

Definition at line 2015 of file SystemZInstrInfo.cpp.

References allOnes(), assert(), llvm::isShiftedMask_64(), and llvm::Length.

Referenced by convertToThreeAddress().

◆ isStackSlotCopy()

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

Definition at line 396 of file SystemZInstrInfo.cpp.

References llvm::MachineFrameInfo::getObjectSize(), llvm::Length, and MI.

◆ isStoreToStackSlot()

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

Definition at line 345 of file SystemZInstrInfo.cpp.

References isSimpleMove(), MI, and llvm::SystemZII::SimpleBDXStore.

◆ isStoreToStackSlotPostFE()

Register SystemZInstrInfo::isStoreToStackSlotPostFE ( const MachineInstr & MI,
int & FrameIndex ) const
override

Definition at line 373 of file SystemZInstrInfo.cpp.

References Accesses, assert(), llvm::cast(), MI, and llvm::SystemZII::SimpleBDXStore.

◆ loadImmediate()

◆ loadRegFromStackSlot()

void SystemZInstrInfo::loadRegFromStackSlot ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator MBBI,
Register DestReg,
int FrameIdx,
const TargetRegisterClass * RC,
const TargetRegisterInfo * TRI,
Register VReg,
MachineInstr::MIFlag Flags = MachineInstr::NoFlags ) const
override

◆ PredicateInstruction()

◆ prepareCompareSwapOperands()

◆ removeBranch()

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

◆ reverseBranchCondition()

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

Definition at line 535 of file SystemZInstrInfo.cpp.

References assert(), Cond, and llvm::getImm().

◆ storeRegToStackSlot()

void SystemZInstrInfo::storeRegToStackSlot ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator MBBI,
Register SrcReg,
bool isKill,
int FrameIndex,
const TargetRegisterClass * RC,
const TargetRegisterInfo * TRI,
Register VReg,
MachineInstr::MIFlag Flags = MachineInstr::NoFlags ) const
override

◆ useMachineCombiner()

bool llvm::SystemZInstrInfo::useMachineCombiner ( ) const
inlineoverride

Definition at line 294 of file SystemZInstrInfo.h.

◆ verifyInstruction()

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

Definition at line 2282 of file SystemZInstrInfo.cpp.

References I, MI, and llvm::MCOI::OPERAND_MEMORY.


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