[llvm] [MC] Fix quadratic runtime within alignment boundary fragment relaxation (PR #176535)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 21:49:55 PST 2026


================
@@ -1005,22 +1002,28 @@ void MCAssembler::layoutSection(MCSection &Sec) {
         F.getParent()->ContentStorage.resize(F.VarContentEnd);
       Offset += Size;
     } else {
+      if (F.getKind() == MCFragment::FT_BoundaryAlign) {
+        auto &BF = cast<MCBoundaryAlignFragment>(F);
+        layoutBoundaryAlign(BF);
----------------
MaskRay wrote:

inline the variable `BF`

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


More information about the llvm-commits mailing list