[PATCH] D25499: BranchRelaxation: Fix computing indirect branch block size

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 17:47:07 PDT 2016


arsenm added inline comments.


================
Comment at: lib/CodeGen/BranchRelaxation.cpp:401-405
   DebugLoc DL = MI.getDebugLoc();
   MI.eraseFromParent();
-
-  // insertUnconditonalBranch may have inserted a new block.
-  BlockInfo[MBB->getNumber()].Size += TII->insertIndirectBranch(
+  BlockInfo[BranchBB->getNumber()].Size += TII->insertIndirectBranch(
     *BranchBB, *DestBB, DL, DestOffset - SrcOffset, RS.get());
 
----------------
nhaehnle wrote:
> This doesn't seem to be affected by your change, but I'm a bit confused about not seeing anything to account for the size change in MBB due to the erased MI.
This is part of the change. I discovered that added/removed instruction size here is insufficient, since updateTerminator can also sneakily change the branch instructions.


https://reviews.llvm.org/D25499





More information about the llvm-commits mailing list