[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:51:56 PST 2026


================
@@ -1032,11 +1035,14 @@ unsigned MCAssembler::relaxOnce(unsigned FirstStable) {
       // sections. Therefore, we must re-evaluate all sections.
       FirstStable = Sections.size();
       Res = I;
-      if (--MaxIter == 0)
+      if (MaxIter == 0)
         break;
       layoutSection(Sec);
     }
+    uint64_t Iterations = Limit - MaxIter;
----------------
MaskRay wrote:

inline `Iterations`

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


More information about the llvm-commits mailing list