LLVM  14.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::LegalizationArtifactCombiner Class Reference

#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...
 

Public Member Functions

 LegalizationArtifactCombiner (MachineIRBuilder &B, MachineRegisterInfo &MRI, const LegalizerInfo &LI)
 
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)
 
bool tryCombineTrunc (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelObserverWrapper &Observer)
 
bool tryFoldImplicitDef (MachineInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs)
 Try to fold G_[ASZ]EXT (G_IMPLICIT_DEF). More...
 
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. 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. More...
 
static unsigned getDefIndex (const MachineInstr &MI, Register SearchDef)
 Return the operand index in MI that defines Def. More...
 

Detailed Description

Definition at line 33 of file LegalizationArtifactCombiner.h.

Constructor & Destructor Documentation

◆ LegalizationArtifactCombiner()

llvm::LegalizationArtifactCombiner::LegalizationArtifactCombiner ( MachineIRBuilder B,
MachineRegisterInfo MRI,
const LegalizerInfo LI 
)
inline

Definition at line 51 of file LegalizationArtifactCombiner.h.

Member Function Documentation

◆ canFoldMergeOpcode()

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

◆ getDefIndex()

static unsigned llvm::LegalizationArtifactCombiner::getDefIndex ( const MachineInstr MI,
Register  SearchDef 
)
inlinestatic

Return the operand index in MI that defines Def.

Definition at line 536 of file LegalizationArtifactCombiner.h.

References llvm::tgtok::Def, and MI.

◆ replaceRegOrBuildCopy()

static void llvm::LegalizationArtifactCombiner::replaceRegOrBuildCopy ( Register  DstReg,
Register  SrcReg,
MachineRegisterInfo MRI,
MachineIRBuilder Builder,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelChangeObserver Observer 
)
inlinestatic

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

Definition at line 511 of file LegalizationArtifactCombiner.h.

References Builder, llvm::canReplaceReg(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), MRI, and UseMI.

◆ tryCombineAnyExt()

bool llvm::LegalizationArtifactCombiner::tryCombineAnyExt ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelObserverWrapper Observer 
)
inline

◆ tryCombineExtract()

bool llvm::LegalizationArtifactCombiner::tryCombineExtract ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs 
)
inline

◆ tryCombineInstruction()

bool llvm::LegalizationArtifactCombiner::tryCombineInstruction ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
GISelObserverWrapper WrapperObserver 
)
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 1060 of file LegalizationArtifactCombiner.h.

References assert(), llvm::GISelObserverWrapper::changedInstr(), llvm::Register::isVirtual(), MI, MRI, and llvm::SmallVectorImpl< T >::pop_back_val().

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

◆ tryCombineSExt()

bool llvm::LegalizationArtifactCombiner::tryCombineSExt ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs 
)
inline

◆ tryCombineTrunc()

bool llvm::LegalizationArtifactCombiner::tryCombineTrunc ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelObserverWrapper Observer 
)
inline

◆ tryCombineUnmergeValues()

bool llvm::LegalizationArtifactCombiner::tryCombineUnmergeValues ( GUnmerge MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelChangeObserver Observer 
)
inline

◆ tryCombineZExt()

bool llvm::LegalizationArtifactCombiner::tryCombineZExt ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelObserverWrapper Observer 
)
inline

◆ tryFoldImplicitDef()

bool llvm::LegalizationArtifactCombiner::tryFoldImplicitDef ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs 
)
inline

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

Definition at line 328 of file LegalizationArtifactCombiner.h.

References assert(), Builder, llvm::dbgs(), DefMI, llvm::getOpcodeDef(), LLVM_DEBUG, MI, and MRI.

◆ tryFoldUnmergeCast()

bool llvm::LegalizationArtifactCombiner::tryFoldUnmergeCast ( MachineInstr MI,
MachineInstr CastMI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs 
)
inline

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