LLVM: llvm::LegalizationArtifactCombiner Class Reference (original) (raw)

#include "[llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h](LegalizationArtifactCombiner%5F8h%5Fsource.html)"

Classes
class ArtifactValueFinder
This class provides utilities for finding source registers of specific bit ranges in an artifact. More...
Public Member Functions
LegalizationArtifactCombiner (MachineIRBuilder &B, MachineRegisterInfo &MRI, const LegalizerInfo &LI, GISelValueTracking *VT=nullptr)
bool tryCombineAnyExt (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
bool tryCombineZExt (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
bool tryCombineSExt (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
bool tryCombineTrunc (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
bool tryFoldImplicitDef (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
Try to fold G_[ASZ]EXT (G_IMPLICIT_DEF).
bool tryFoldUnmergeCast (MachineInstr &MI, MachineInstr &CastMI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs)
bool tryCombineUnmergeValues (GUnmerge &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelChangeObserver &Observer)
bool tryCombineExtract (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs)
bool tryCombineInstruction (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, GISelObserverWrapper &WrapperObserver)
Try to combine away MI.
Static Public Member Functions
static bool canFoldMergeOpcode (unsigned MergeOp, unsigned ConvertOp, LLT OpTy, LLT DestTy)
static void replaceRegOrBuildCopy (Register DstReg, Register SrcReg, MachineRegisterInfo &MRI, MachineIRBuilder &Builder, SmallVectorImpl< Register > &UpdatedDefs, GISelChangeObserver &Observer)
Try to replace DstReg with SrcReg or build a COPY instruction depending on the register constraints.
static unsigned getDefIndex (const MachineInstr &MI, Register SearchDef)
Return the operand index in MI that defines Def.

canFoldMergeOpcode()

bool llvm::LegalizationArtifactCombiner::canFoldMergeOpcode ( unsigned MergeOp, unsigned ConvertOp, LLT OpTy, LLT DestTy ) inlinestatic

getDefIndex()

replaceRegOrBuildCopy()

Try to replace DstReg with SrcReg or build a COPY instruction depending on the register constraints.

Definition at line 570 of file LegalizationArtifactCombiner.h.

References llvm::canReplaceReg(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and UseMI.

Referenced by tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineMergeLike(), tryCombineSExt(), tryCombineTrunc(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), tryCombineUnmergeValues(), tryCombineZExt(), and tryFoldImplicitDef().

tryCombineAnyExt()

Definition at line 59 of file LegalizationArtifactCombiner.h.

References assert(), llvm::dbgs(), llvm::DebugLoc::getMergedLocation(), llvm::MachineInstr::getOpcode(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, llvm::MIPatternMatch::m_all_of(), llvm::MIPatternMatch::m_any_of(), llvm::MIPatternMatch::m_GAnyExt(), llvm::MIPatternMatch::m_GSExt(), llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_GZExt(), llvm::MIPatternMatch::m_MInstr(), llvm::MIPatternMatch::m_Reg(), MI, llvm::MIPatternMatch::mi_match(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), and tryFoldImplicitDef().

Referenced by tryCombineInstruction().

tryCombineExtract()

Definition at line 1284 of file LegalizationArtifactCombiner.h.

References assert(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::LLT::getSizeInBits(), llvm::isa(), MI, llvm::Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by tryCombineInstruction().

tryCombineInstruction()

Try to combine away MI.

Returns true if it combined away the MI. Adds instructions that are dead as a result of the combine into DeadInsts, which can include MI.

Definition at line 1344 of file LegalizationArtifactCombiner.h.

References assert(), llvm::cast(), Changed, llvm::GISelObserverWrapper::changedInstr(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::Register::isVirtual(), MI, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), tryCombineAnyExt(), tryCombineExtract(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineMergeLike(), tryCombineSExt(), tryCombineTrunc(), tryCombineUnmergeValues(), and tryCombineZExt().

Referenced by llvm::Legalizer::legalizeMachineFunction().

tryCombineSExt()

Definition at line 193 of file LegalizationArtifactCombiner.h.

References assert(), llvm::dbgs(), llvm::MachineInstr::getOpcode(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, llvm::MIPatternMatch::m_all_of(), llvm::MIPatternMatch::m_any_of(), llvm::MIPatternMatch::m_GSExt(), llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_GZExt(), llvm::MIPatternMatch::m_MInstr(), llvm::MIPatternMatch::m_Reg(), MI, llvm::MIPatternMatch::mi_match(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), and tryFoldImplicitDef().

Referenced by tryCombineInstruction().

tryCombineTrunc()

Definition at line 258 of file LegalizationArtifactCombiner.h.

References assert(), llvm::dbgs(), llvm::dyn_cast(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::findValueFromDef(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), LLVM_DEBUG, llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_Reg(), MI, llvm::MIPatternMatch::mi_match(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and replaceRegOrBuildCopy().

Referenced by tryCombineInstruction().

tryCombineUnmergeValues()

Definition at line 1074 of file LegalizationArtifactCombiner.h.

References llvm::LegalizeActionStep::Action, llvm::dyn_cast(), llvm::LegalizeActions::FewerElements, getDefIndex(), llvm::getDefSrcRegIgnoringCopies(), I, llvm::LLT::isVector(), llvm::LegalizeActions::Legal, llvm::LegalizeActions::Lower, MI, llvm::LegalizeActions::NarrowScalar, replaceRegOrBuildCopy(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), llvm::LegalizeActionStep::TypeIdx, and llvm::LegalizeActions::Unsupported.

Referenced by combineAwayG_UNMERGE_VALUES(), and tryCombineInstruction().

tryCombineZExt()

Definition at line 118 of file LegalizationArtifactCombiner.h.

References assert(), llvm::GISelObserverWrapper::changedInstr(), llvm::GISelObserverWrapper::changingInstr(), llvm::dbgs(), llvm::APInt::getAllOnes(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, llvm::MIPatternMatch::m_GSExt(), llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_GZExt(), llvm::MIPatternMatch::m_Reg(), MI, llvm::MIPatternMatch::mi_match(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), tryFoldImplicitDef(), and llvm::APInt::zext().

Referenced by tryCombineInstruction().

tryFoldImplicitDef()

Try to fold G_[ASZ]EXT (G_IMPLICIT_DEF).

Definition at line 377 of file LegalizationArtifactCombiner.h.

References assert(), llvm::dbgs(), DefMI, llvm::getOpcodeDef(), LLVM_DEBUG, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and replaceRegOrBuildCopy().

Referenced by tryCombineAnyExt(), tryCombineSExt(), and tryCombineZExt().

tryFoldUnmergeCast()

Definition at line 418 of file LegalizationArtifactCombiner.h.

References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::LLT::changeElementCount(), llvm::ElementCount::getFixed(), llvm::LLT::getNumElements(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::LLT::getScalarType(), llvm::LLT::getSizeInBits(), I, llvm::LLT::isScalar(), llvm::LLT::isVector(), MI, llvm::LegalizeActions::MoreElements, and llvm::SmallVectorTemplateBase< T, bool >::push_back().


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