[llvm] [GISel][AMDGPU] Expand ShuffleVector (PR #124527)
Alan Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 27 09:46:53 PST 2025
================
@@ -384,6 +384,45 @@ void CombinerHelper::applyCombineConcatVectors(
MI.eraseFromParent();
}
+bool CombinerHelper::matchCombineShuffleToBuildVector(MachineInstr &MI) const {
+ assert(MI.getOpcode() == TargetOpcode::G_SHUFFLE_VECTOR &&
+ "Invalid instruction");
+ auto &Shuffle = cast<GShuffleVector>(MI);
+
+ auto SrcVec1 = Shuffle.getSrc1Reg();
+ auto SrcVec2 = Shuffle.getSrc2Reg();
+
+ LLT SrcVec1Type = MRI.getType(SrcVec1);
+ LLT SrcVec2Type = MRI.getType(SrcVec2);
+ return SrcVec1Type.isVector() && SrcVec2Type.isVector();
----------------
lialan wrote:
Do we still need it if we want to combine before legalization?
https://github.com/llvm/llvm-project/pull/124527
More information about the llvm-commits
mailing list