@@ -211,11 +211,32 @@ CombinerHelper::GeneratorType sectionGenerator(const int32_t From,
211211
212212bool AIE2PreLegalizerCombinerImpl::tryCombineShuffleVector (
213213 MachineInstr &MI) const {
214+ const Register DstReg = MI.getOperand (0 ).getReg ();
215+ const LLT DstTy = MRI.getType (DstReg);
216+ const LLT SrcTy = MRI.getType (MI.getOperand (1 ).getReg ());
217+ const unsigned DstNumElts = DstTy.isVector () ? DstTy.getNumElements () : 1 ;
218+ const unsigned SrcNumElts = SrcTy.isVector () ? SrcTy.getNumElements () : 1 ;
219+ MachineIRBuilder MIB (MI);
220+ MachineRegisterInfo &MRI = *MIB.getMRI ();
221+
214222 if (Helper.tryCombineShuffleVector (MI))
215223 return true ;
216224
225+ const LLT V64S8 = LLT::fixed_vector (64 , 8 );
226+ CombinerHelper::GeneratorType FourPartitions =
227+ sectionGenerator (0 , DstNumElts, 4 , 1 );
228+ if (Helper.matchCombineShuffleVector (MI, FourPartitions, DstNumElts))
229+ return createVShuffle (MI, V64S8, 35 );
230+
231+ const LLT V32S16 = LLT::fixed_vector (32 , 16 );
232+ CombinerHelper::GeneratorType FourPartitionByTwo =
233+ sectionGenerator (0 , DstNumElts, 4 , 2 );
234+ if (Helper.matchCombineShuffleVector (MI, FourPartitionByTwo, DstNumElts))
235+ return createVShuffle (MI, V32S16, 29 );
236+
217237 return false ;
218238}
239+
219240bool AIE2PreLegalizerCombinerImpl::tryCombineAll (MachineInstr &MI) const {
220241 if (tryCombineAllImpl (MI))
221242 return true ;
0 commit comments