Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ class CombinerHelper {
/// or an implicit_def if \p Ops is empty.
void applyCombineShuffleConcat(MachineInstr &MI, SmallVector<Register> &Ops);

/// Check if an instruction whose operations can be represented
/// by a mapping from one index to another in a vector can be replaced
/// by another operations.
/// \p Ops will contain the operands to produce the flattened
/// operation.
/// \p Mask is an array to numbers that represent the order that
/// the elements of \p SrcRegs will be put into \p DstReg.
bool analysePatternVectorMask(MachineInstr &MI, SmallVectorImpl<Register> &Ops,
const Register DstReg,
const std::pair<Register, Register> SrcRegs,
ArrayRef<int> Mask);

/// Try to combine G_SHUFFLE_VECTOR into G_CONCAT_VECTORS.
/// Returns true if MI changed.
///
Expand Down Expand Up @@ -580,6 +592,12 @@ class CombinerHelper {
bool matchExtractVecEltBuildVec(MachineInstr &MI, Register &Reg);
void applyExtractVecEltBuildVec(MachineInstr &MI, Register &Reg);

/// Combine extracts of two different arrays into one build vector into a
/// shuffle vector.
bool
matchCombineExtractToShuffle(MachineInstr &MI, SmallVectorImpl<Register> &Ops,
std::pair<Register, Register> &VectorRegisters);

bool matchExtractAllEltsFromBuildVector(
MachineInstr &MI,
SmallVectorImpl<std::pair<Register, MachineInstr *>> &MatchInfo);
Expand Down
Loading