[PATCH] D38918: Update successor after branch relaxation in ARM

Sameer AbuAsal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 12:16:09 PDT 2017


sabuasal updated this revision to Diff 119193.
sabuasal added a comment.

Updated diff  to include context.


Repository:
  rL LLVM

https://reviews.llvm.org/D38918

Files:
  lib/Target/ARM/ARMConstantIslandPass.cpp


Index: lib/Target/ARM/ARMConstantIslandPass.cpp
===================================================================
--- lib/Target/ARM/ARMConstantIslandPass.cpp
+++ lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1713,6 +1713,13 @@
   unsigned MaxDisp = getUnconditionalBrDisp(Br.UncondBr);
   ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr));
 
+  if (NeedSplit) {
+    // When we split the MBB we transferred all its successors to the newly
+    // created block so the DestBB is no longer marked as a predecessor. Add
+    // it back here.
+    MBB->addSuccessor(DestBB);
+  }
+
   // Remove the old conditional branch.  It may or may not still be in MBB.
   BBInfo[MI->getParent()->getNumber()].Size -= TII->getInstSizeInBytes(*MI);
   MI->eraseFromParent();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38918.119193.patch
Type: text/x-patch
Size: 787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171016/19e21f52/attachment.bin>


More information about the llvm-commits mailing list