LLVM 20.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 MRI.
|
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.
|
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::MachineIRBuilder::buildCopy(), llvm::canReplaceReg(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and UseMI.
Referenced by tryCombineAnyExt(), tryCombineSExt(), tryCombineTrunc(), tryCombineZExt(), and tryFoldImplicitDef().
|
inline |
Definition at line 59 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineIRBuilder::buildAnyExtOrTrunc(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildInstr(), llvm::dbgs(), llvm::DILocation::getMergedLocation(), llvm::MachineInstr::getOpcode(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), llvm::MachineIRBuilder::setDebugLoc(), llvm::MachineIRBuilder::setInstrAndDebugLoc(), and tryFoldImplicitDef().
|
inline |
Definition at line 1269 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::LLT::getSizeInBits(), MI, MRI, Offset, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
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 1322 of file LegalizationArtifactCombiner.h.
References assert(), 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(), and llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineMergeLike().
Referenced by llvm::Legalizer::legalizeMachineFunction().
|
inline |
Definition at line 193 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineIRBuilder::buildAnyExtOrTrunc(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildInstr(), llvm::MachineIRBuilder::buildSExtInReg(), llvm::GISelKnownBits::computeNumSignBits(), llvm::dbgs(), llvm::MachineInstr::getOpcode(), llvm::MachineInstrBuilder::getReg(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), llvm::MachineIRBuilder::setInstrAndDebugLoc(), and tryFoldImplicitDef().
|
inline |
Definition at line 258 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildMergeValues(), llvm::MachineIRBuilder::buildTrunc(), llvm::dbgs(), llvm::LegalizationArtifactCombiner::ArtifactValueFinder::findValueFromDef(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), and llvm::MachineIRBuilder::setInstr().
|
inline |
Definition at line 1061 of file LegalizationArtifactCombiner.h.
References llvm::LegalizeActionStep::Action, llvm::LegalizeActions::FewerElements, llvm::getDefIgnoringCopies(), I, llvm::LLT::isVector(), llvm::LegalizeActions::Legal, llvm::LegalizeActions::Lower, MI, MRI, llvm::LegalizeActions::NarrowScalar, llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs(), llvm::LegalizeActionStep::TypeIdx, and llvm::LegalizeActions::Unsupported.
Referenced by combineAwayG_UNMERGE_VALUES().
|
inline |
Definition at line 118 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineIRBuilder::buildAnd(), llvm::MachineIRBuilder::buildAnyExtOrTrunc(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildSExtOrTrunc(), llvm::GISelObserverWrapper::changedInstr(), llvm::GISelObserverWrapper::changingInstr(), llvm::dbgs(), llvm::APInt::getAllOnes(), llvm::GISelKnownBits::getKnownZeroes(), llvm::MachineInstrBuilder::getReg(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), llvm::MachineIRBuilder::setInstrAndDebugLoc(), tryFoldImplicitDef(), and llvm::APInt::zext().
|
inline |
Try to fold G_[ASZ]EXT (G_IMPLICIT_DEF).
Definition at line 377 of file LegalizationArtifactCombiner.h.
References assert(), llvm::MachineIRBuilder::buildConstant(), llvm::MachineIRBuilder::buildUndef(), llvm::dbgs(), DefMI, llvm::getOpcodeDef(), LLVM_DEBUG, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceRegOrBuildCopy(), and llvm::MachineIRBuilder::setInstr().
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::MachineIRBuilder::buildTrunc(), llvm::MachineIRBuilder::buildUnmerge(), llvm::LLT::changeElementCount(), llvm::LegalizerInfo::getAction(), 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, llvm::LegalizeActions::MoreElements, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineIRBuilder::setInstr().