LLVM 20.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, GISelKnownBits *KB=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)
 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.
 

Detailed Description

Definition at line 35 of file LegalizationArtifactCombiner.h.

Constructor & Destructor Documentation

◆ LegalizationArtifactCombiner()

llvm::LegalizationArtifactCombiner::LegalizationArtifactCombiner ( MachineIRBuilder B,
MachineRegisterInfo MRI,
const LegalizerInfo LI,
GISelKnownBits KB = nullptr 
)
inline

Definition at line 54 of file LegalizationArtifactCombiner.h.

References MRI.

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 590 of file LegalizationArtifactCombiner.h.

References MI.

◆ replaceRegOrBuildCopy()

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

◆ 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

◆ tryCombineSExt()

bool llvm::LegalizationArtifactCombiner::tryCombineSExt ( MachineInstr MI,
SmallVectorImpl< MachineInstr * > &  DeadInsts,
SmallVectorImpl< Register > &  UpdatedDefs,
GISelObserverWrapper Observer 
)
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

◆ 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: