[SPARC]  Attempt to fix bug introduced by D142458

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

(cherry picked from commit ea4cbbbfa4207c30888acffc499c8fc71cd3d84f)
diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
index cccce42..a3a09a3 100644
--- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
@@ -354,8 +354,8 @@
         !isUncondBranchOpcode(I->getOpcode()))
       break; // Not a branch
 
-    I->eraseFromParent();
     Removed += getInstSizeInBytes(*I);
+    I->eraseFromParent();
     I = MBB.end();
     ++Count;
   }