LLVM 17.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 33 of file LegalizationArtifactCombiner.h.
|
inline |
Definition at line 51 of file LegalizationArtifactCombiner.h.
|
inlinestatic |
Definition at line 462 of file LegalizationArtifactCombiner.h.
References llvm::LLT::getElementType(), llvm::LLT::getSizeInBits(), and llvm::LLT::isVector().
Referenced by tryCombineUnmergeValues().
|
inlinestatic |
Return the operand index in MI
that defines Def
.
Definition at line 541 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 516 of file LegalizationArtifactCombiner.h.
References Builder, llvm::canReplaceReg(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and UseMI.
Referenced by tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineMergeLike(), tryCombineTrunc(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), and tryCombineUnmergeValues().
|
inline |
Definition at line 55 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::dbgs(), llvm::MachineInstr::getOpcode(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), and tryFoldImplicitDef().
Referenced by tryCombineInstruction().
|
inline |
Definition at line 1146 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::LLT::getSizeInBits(), MI, MRI, 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 1199 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::GISelObserverWrapper::changedInstr(), llvm::SmallVectorBase< Size_T >::empty(), llvm::Register::isVirtual(), MI, MRI, 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 172 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::dbgs(), llvm::MachineInstr::getOpcode(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and tryFoldImplicitDef().
Referenced by tryCombineInstruction().
|
inline |
Definition at line 229 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::dbgs(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and replaceRegOrBuildCopy().
Referenced by tryCombineInstruction().
|
inline |
Definition at line 944 of file LegalizationArtifactCombiner.h.
References llvm::LegalizeActionStep::Action, llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), Builder, canFoldMergeOpcode(), llvm::LLT::divide(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::LegalizeActions::FewerElements, llvm::LegalizerInfo::getAction(), llvm::getDefIgnoringCopies(), getDefIndex(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), I, Idx, llvm::LegalizeActions::Lower, MI, MRI, llvm::LegalizeActions::NarrowScalar, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), tryFoldUnmergeCast(), llvm::LegalizeActionStep::TypeIdx, and llvm::LegalizeActions::Unsupported.
Referenced by combineAwayG_UNMERGE_VALUES(), and tryCombineInstruction().
|
inline |
Definition at line 109 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::GISelObserverWrapper::changedInstr(), llvm::GISelObserverWrapper::changingInstr(), llvm::dbgs(), llvm::APInt::getAllOnes(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), tryFoldImplicitDef(), and llvm::APInt::zext().
Referenced by tryCombineInstruction().
|
inline |
Try to fold G_[ASZ]EXT (G_IMPLICIT_DEF).
Definition at line 332 of file LegalizationArtifactCombiner.h.
References assert(), Builder, llvm::dbgs(), DefMI, llvm::getOpcodeDef(), LLVM_DEBUG, MI, MRI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by tryCombineAnyExt(), tryCombineSExt(), and tryCombineZExt().
|
inline |
Definition at line 368 of file LegalizationArtifactCombiner.h.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), Builder, 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, Idx, llvm::LLT::isScalar(), llvm::LLT::isVector(), MI, MRI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by tryCombineUnmergeValues().