LLVM 20.0.0git
Public Member Functions | List of all members
llvm::LegalizationArtifactCombiner::ArtifactValueFinder Class Reference

This class provides utilities for finding source registers of specific bit ranges in an artifact. More...

#include "llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h"

Public Member Functions

 ArtifactValueFinder (MachineRegisterInfo &Mri, MachineIRBuilder &Builder, const LegalizerInfo &Info)
 
Register findValueFromDef (Register DefReg, unsigned StartBit, unsigned Size)
 Try to find a source of the value defined in the def DefReg, starting at position StartBit with size Size.
 
bool tryCombineUnmergeDefs (GUnmerge &MI, GISelChangeObserver &Observer, SmallVectorImpl< Register > &UpdatedDefs)
 Try to combine the defs of an unmerge MI by attempting to find values that provides the bits for each def reg.
 
GUnmergefindUnmergeThatDefinesReg (Register Reg, unsigned Size, unsigned &DefOperandIdx)
 
bool isSequenceFromUnmerge (GMergeLikeInstr &MI, unsigned MergeStartIdx, GUnmerge *Unmerge, unsigned UnmergeIdxStart, unsigned NumElts, unsigned EltSize, bool AllowUndef)
 
bool tryCombineMergeLike (GMergeLikeInstr &MI, SmallVectorImpl< MachineInstr * > &DeadInsts, SmallVectorImpl< Register > &UpdatedDefs, GISelChangeObserver &Observer)
 

Detailed Description

This class provides utilities for finding source registers of specific bit ranges in an artifact.

The routines can look through the source registers if they're other artifacts to try to find a non-artifact source of a value.

Definition at line 605 of file LegalizationArtifactCombiner.h.

Constructor & Destructor Documentation

◆ ArtifactValueFinder()

llvm::LegalizationArtifactCombiner::ArtifactValueFinder::ArtifactValueFinder ( MachineRegisterInfo Mri,
MachineIRBuilder Builder,
const LegalizerInfo Info 
)
inline

Definition at line 872 of file LegalizationArtifactCombiner.h.

Member Function Documentation

◆ findUnmergeThatDefinesReg()

GUnmerge * llvm::LegalizationArtifactCombiner::ArtifactValueFinder::findUnmergeThatDefinesReg ( Register  Reg,
unsigned  Size,
unsigned DefOperandIdx 
)
inline

Definition at line 919 of file LegalizationArtifactCombiner.h.

References MRI, Reg, and Size.

◆ findValueFromDef()

Register llvm::LegalizationArtifactCombiner::ArtifactValueFinder::findValueFromDef ( Register  DefReg,
unsigned  StartBit,
unsigned  Size 
)
inline

Try to find a source of the value defined in the def DefReg, starting at position StartBit with size Size.

Returns
a register with the requested size, or an empty Register if no better value could be found.

Definition at line 880 of file LegalizationArtifactCombiner.h.

References Register, and Size.

Referenced by llvm::LegalizationArtifactCombiner::tryCombineTrunc().

◆ isSequenceFromUnmerge()

bool llvm::LegalizationArtifactCombiner::ArtifactValueFinder::isSequenceFromUnmerge ( GMergeLikeInstr MI,
unsigned  MergeStartIdx,
GUnmerge Unmerge,
unsigned  UnmergeIdxStart,
unsigned  NumElts,
unsigned  EltSize,
bool  AllowUndef 
)
inline

Definition at line 934 of file LegalizationArtifactCombiner.h.

References assert(), MI, and MRI.

◆ tryCombineMergeLike()

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

◆ tryCombineUnmergeDefs()

bool llvm::LegalizationArtifactCombiner::ArtifactValueFinder::tryCombineUnmergeDefs ( GUnmerge MI,
GISelChangeObserver Observer,
SmallVectorImpl< Register > &  UpdatedDefs 
)
inline

Try to combine the defs of an unmerge MI by attempting to find values that provides the bits for each def reg.

Returns
true if all the defs of the unmerge have been made dead.

Definition at line 890 of file LegalizationArtifactCombiner.h.

References llvm::SmallBitVector::all(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingInstr(), llvm::LLT::getSizeInBits(), MI, and MRI.

Referenced by llvm::LegalizationArtifactCombiner::tryCombineUnmergeValues().


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