[llvm] [BranchRelaxation] Remove quadratic behavior in relaxation pass (PR #96250)

Daniel Hoekwater via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 10:06:14 PDT 2024


================
@@ -590,7 +604,7 @@ bool BranchRelaxation::fixupUnconditionalBranch(MachineInstr &MI) {
                             RS.get());
 
   BlockInfo[BranchBB->getNumber()].Size = computeBlockSize(*BranchBB);
-  adjustBlockOffsets(*MBB);
+  adjustBlockOffsets(*MBB, std::next(BranchBB->getIterator()));
 
----------------
dhoekwater wrote:

Added! The path after this function is `MBB -> BranchBB -> RestoreBB -> DestBB`.

https://github.com/llvm/llvm-project/pull/96250


More information about the llvm-commits mailing list