LLVM 22.0.0git
|
#include "llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h"
Classes | |
class | ArtifactValueFinder |
This class provides utilities for finding source registers of specific bit ranges in an artifact. More... |
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 . |
Definition at line 35 of file LegalizationArtifactCombiner.h.
|
inline |
Definition at line 54 of file LegalizationArtifactCombiner.h.
References B().
|
inlinestatic |
Definition at line 516 of file LegalizationArtifactCombiner.h.
References llvm::LLT::getElementType(), llvm::LLT::getSizeInBits(), and llvm::LLT::isVector().
|
inlinestatic |
Return the operand index in MI
that defines Def
.
Definition at line 595 of file LegalizationArtifactCombiner.h.
References MI.
Referenced by tryCombineUnmergeValues().
|
inlinestatic |
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().
|
inline |
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().
|
inline |
Definition at line 1274 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::LLT::getSizeInBits(), llvm::isa(), MI, llvm::Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by tryCombineInstruction().
|
inline |
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 1327 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().
|
inline |
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().
|
inline |
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().
|
inline |
Definition at line 1064 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().
|
inline |
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().
|
inline |
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().
|
inline |
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().