@@ -3558,8 +3558,6 @@ bool AArch64InstructionSelector::select(MachineInstr &I) {
3558
3558
return selectConcatVectors (I, MRI);
3559
3559
case TargetOpcode::G_JUMP_TABLE:
3560
3560
return selectJumpTable (I, MRI);
3561
- case TargetOpcode::G_VECREDUCE_ADD:
3562
- return selectReduction (I, MRI);
3563
3561
case TargetOpcode::G_MEMCPY:
3564
3562
case TargetOpcode::G_MEMCPY_INLINE:
3565
3563
case TargetOpcode::G_MEMMOVE:
@@ -3578,49 +3576,6 @@ bool AArch64InstructionSelector::selectAndRestoreState(MachineInstr &I) {
3578
3576
return Success;
3579
3577
}
3580
3578
3581
- bool AArch64InstructionSelector::selectReduction (MachineInstr &I,
3582
- MachineRegisterInfo &MRI) {
3583
- Register VecReg = I.getOperand (1 ).getReg ();
3584
- LLT VecTy = MRI.getType (VecReg);
3585
- if (I.getOpcode () == TargetOpcode::G_VECREDUCE_ADD) {
3586
- // For <2 x i32> ADDPv2i32 generates an FPR64 value, so we need to emit
3587
- // a subregister copy afterwards.
3588
- if (VecTy == LLT::fixed_vector (2 , 32 )) {
3589
- Register DstReg = I.getOperand (0 ).getReg ();
3590
- auto AddP = MIB.buildInstr (AArch64::ADDPv2i32, {&AArch64::FPR64RegClass},
3591
- {VecReg, VecReg});
3592
- auto Copy = MIB.buildInstr (TargetOpcode::COPY, {DstReg}, {})
3593
- .addReg (AddP.getReg (0 ), 0 , AArch64::ssub)
3594
- .getReg (0 );
3595
- RBI.constrainGenericRegister (Copy, AArch64::FPR32RegClass, MRI);
3596
- I.eraseFromParent ();
3597
- return constrainSelectedInstRegOperands (*AddP, TII, TRI, RBI);
3598
- }
3599
-
3600
- unsigned Opc = 0 ;
3601
- if (VecTy == LLT::fixed_vector (16 , 8 ))
3602
- Opc = AArch64::ADDVv16i8v;
3603
- else if (VecTy == LLT::fixed_vector (8 , 8 ))
3604
- Opc = AArch64::ADDVv8i8v;
3605
- else if (VecTy == LLT::fixed_vector (8 , 16 ))
3606
- Opc = AArch64::ADDVv8i16v;
3607
- else if (VecTy == LLT::fixed_vector (4 , 16 ))
3608
- Opc = AArch64::ADDVv4i16v;
3609
- else if (VecTy == LLT::fixed_vector (4 , 32 ))
3610
- Opc = AArch64::ADDVv4i32v;
3611
- else if (VecTy == LLT::fixed_vector (2 , 64 ))
3612
- Opc = AArch64::ADDPv2i64p;
3613
- else {
3614
- LLVM_DEBUG (dbgs () << " Unhandled type for add reduction" );
3615
- return false ;
3616
- }
3617
- I.setDesc (TII.get (Opc));
3618
- return constrainSelectedInstRegOperands (I, TII, TRI, RBI);
3619
- }
3620
-
3621
- return false ;
3622
- }
3623
-
3624
3579
bool AArch64InstructionSelector::selectMOPS (MachineInstr &GI,
3625
3580
MachineRegisterInfo &MRI) {
3626
3581
unsigned Mopcode;
0 commit comments