[llvm] [AMDGPU] Invert scc uses to delete s_cmp_eq* (PR #167382)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 07:41:10 PST 2025


================
@@ -6487,6 +6487,17 @@ SITargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
     MI.getOperand(0).setReg(OriginalExec);
     return BB;
   }
+  case AMDGPU::S_CBRANCH_SCC0:
+  case AMDGPU::S_CBRANCH_SCC1: {
+    MachineBasicBlock *TBB = nullptr;
+    MachineBasicBlock *FBB = nullptr;
+    SmallVector<MachineOperand, 1> Cond;
+    TII->analyzeBranch(*BB, TBB, FBB, Cond);
+    if (TBB && !TBB->isLiveIn(AMDGPU::SCC) && FBB &&
+        !FBB->isLiveIn(AMDGPU::SCC))
+      MI.addRegisterKilled(AMDGPU::SCC, TRI);
+  }
+    return BB;
----------------
LU-JOHN wrote:

Changed.

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


More information about the llvm-commits mailing list