@@ -11698,47 +11698,6 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
11698
11698
return ;
11699
11699
}
11700
11700
11701
- // Replace unused atomics with the no return version.
11702
- int NoRetAtomicOp = AMDGPU::getAtomicNoRetOp (MI.getOpcode ());
11703
- if (NoRetAtomicOp != -1 ) {
11704
- if (!Node->hasAnyUseOfValue (0 )) {
11705
- int CPolIdx = AMDGPU::getNamedOperandIdx (MI.getOpcode (),
11706
- AMDGPU::OpName::cpol);
11707
- if (CPolIdx != -1 ) {
11708
- MachineOperand &CPol = MI.getOperand (CPolIdx);
11709
- CPol.setImm (CPol.getImm () & ~AMDGPU::CPol::GLC);
11710
- }
11711
- MI.removeOperand (0 );
11712
- MI.setDesc (TII->get (NoRetAtomicOp));
11713
- return ;
11714
- }
11715
-
11716
- // For mubuf_atomic_cmpswap, we need to have tablegen use an extract_subreg
11717
- // instruction, because the return type of these instructions is a vec2 of
11718
- // the memory type, so it can be tied to the input operand.
11719
- // This means these instructions always have a use, so we need to add a
11720
- // special case to check if the atomic has only one extract_subreg use,
11721
- // which itself has no uses.
11722
- if ((Node->hasNUsesOfValue (1 , 0 ) &&
11723
- Node->use_begin ()->isMachineOpcode () &&
11724
- Node->use_begin ()->getMachineOpcode () == AMDGPU::EXTRACT_SUBREG &&
11725
- !Node->use_begin ()->hasAnyUseOfValue (0 ))) {
11726
- Register Def = MI.getOperand (0 ).getReg ();
11727
-
11728
- // Change this into a noret atomic.
11729
- MI.setDesc (TII->get (NoRetAtomicOp));
11730
- MI.removeOperand (0 );
11731
-
11732
- // If we only remove the def operand from the atomic instruction, the
11733
- // extract_subreg will be left with a use of a vreg without a def.
11734
- // So we need to insert an implicit_def to avoid machine verifier
11735
- // errors.
11736
- BuildMI (*MI.getParent (), MI, MI.getDebugLoc (),
11737
- TII->get (AMDGPU::IMPLICIT_DEF), Def);
11738
- }
11739
- return ;
11740
- }
11741
-
11742
11701
if (TII->isMIMG (MI) && !MI.mayStore ())
11743
11702
AddIMGInit (MI);
11744
11703
}
0 commit comments