[llvm-branch-commits] [llvm-branch] r88918 - /llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp

Jim Grosbach grosbach at apple.com
Mon Nov 16 09:16:42 PST 2009


Author: grosbach
Date: Mon Nov 16 11:16:42 2009
New Revision: 88918

URL: http://llvm.org/viewvc/llvm-project?rev=88918&view=rev
Log:
Merge 88917

Modified:
    llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp

Modified: llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=88918&r1=88917&r2=88918&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Nov 16 11:16:42 2009
@@ -1772,13 +1772,15 @@
   int Size = BBSizes[BBI];
   MachineBasicBlock *TBB = 0, *FBB = 0;
   SmallVector<MachineOperand, 4> Cond;
-  // If the block is small and ends in an unconditional branch, move it.
-  if (Size < 50 && Cond.empty()) {
-    // If the block terminator isn't analyzable, don't try to move the block
-    if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond))
-      return NULL;
 
-    MachineFunction::iterator OldPrior = prior(BB);
+  // If the block terminator isn't analyzable, don't try to move the block
+  if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond))
+    return NULL;
+
+  // If the block is small and ends in an unconditional branch, move it.
+  if (Size < 50 && Cond.empty() && BB != MF.begin()) {
+    MachineFunction::iterator BBi = BB;
+    MachineFunction::iterator OldPrior = prior(BBi);
     BB->moveAfter(JTBB);
     OldPrior->updateTerminator();
     BB->updateTerminator();





More information about the llvm-branch-commits mailing list