[llvm] ea4cbbb - [SPARC] Attempt to fix bug introduced by D142458

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 12 18:32:37 PDT 2023


Author: Vitaly Buka
Date: 2023-03-12T18:32:24-07:00
New Revision: ea4cbbbfa4207c30888acffc499c8fc71cd3d84f

URL: https://github.com/llvm/llvm-project/commit/ea4cbbbfa4207c30888acffc499c8fc71cd3d84f
DIFF: https://github.com/llvm/llvm-project/commit/ea4cbbbfa4207c30888acffc499c8fc71cd3d84f.diff

LOG: [SPARC]  Attempt to fix bug introduced by D142458

Reported https://lab.llvm.org/buildbot/#/builders/5/builds/32113

Added: 
    

Modified: 
    llvm/lib/Target/Sparc/SparcInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
index cccce42d0438..a3a09a36f1dd 100644
--- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
@@ -354,8 +354,8 @@ unsigned SparcInstrInfo::removeBranch(MachineBasicBlock &MBB,
         !isUncondBranchOpcode(I->getOpcode()))
       break; // Not a branch
 
-    I->eraseFromParent();
     Removed += getInstSizeInBytes(*I);
+    I->eraseFromParent();
     I = MBB.end();
     ++Count;
   }


        


More information about the llvm-commits mailing list