[llvm] [Codegen] Remove redundant instruction using machinelateCleanup (PR #139716)
    Rohit Aggarwal via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu May 15 05:52:08 PDT 2025
    
    
  
================
@@ -186,11 +186,13 @@ static bool isCandidate(const MachineInstr *MI, Register &DefedReg,
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
     const MachineOperand &MO = MI->getOperand(i);
     if (MO.isReg()) {
-      if (MO.isDef()) {
+      if (MO.isDef() && DefedReg == MCRegister::NoRegister) {
----------------
rohitaggarwal007 wrote:
I have updated the patch. Please check
https://github.com/llvm/llvm-project/pull/139716
    
    
More information about the llvm-commits
mailing list