[llvm] [AMDGPU] Remove unneeded code from EmitInstrWithCustomInserter. NFC. (PR #225919)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 00:56:56 PDT 2026


================
@@ -7324,35 +7324,9 @@ SITargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
   }
   case AMDGPU::V_ADD_CO_U32_e32:
   case AMDGPU::V_SUB_CO_U32_e32:
-  case AMDGPU::V_SUBREV_CO_U32_e32: {
-    // TODO: Define distinct V_*_I32_Pseudo instructions instead.
-    unsigned Opc = MI.getOpcode();
-
-    bool NeedClampOperand = false;
-    if (TII->pseudoToMCOpcode(Opc) == -1) {
-      Opc = AMDGPU::getVOPe64(Opc);
-      NeedClampOperand = true;
-    }
-
-    bool VCCDead = MI.getOperand(3).isDead();
-
-    auto I = BuildMI(*BB, MI, DL, TII->get(Opc), MI.getOperand(0).getReg());
-    bool IsVOP3 = TII->isVOP3(*I);
-    if (IsVOP3)
-      I.addReg(TRI->getVCC(), RegState::Define | getDeadRegState(VCCDead));
-
-    I.add(MI.getOperand(1)).add(MI.getOperand(2));
-    if (NeedClampOperand)
-      I.addImm(0); // clamp bit for e64 encoding
-
-    if (!IsVOP3 && VCCDead)
-      I.setOperandDead(3);
-
-    TII->legalizeOperands(*I);
-
-    MI.eraseFromParent();
+  case AMDGPU::V_SUBREV_CO_U32_e32:
+    // TODO: Remove usesCustomInserter from these instructions.
----------------
jayfoad wrote:

Actually it was pretty easy: #226055

https://github.com/llvm/llvm-project/pull/225919


More information about the llvm-commits mailing list