[all-commits] [llvm/llvm-project] cde8d0: [ARM][Thumb1] Verify EstimateFunctionSizeInBytes e...

Simon Tatham via All-commits all-commits at lists.llvm.org
Thu Jun 11 09:02:56 PDT 2026


  Branch: refs/heads/users/statham-arm/thumb1-estimation-check
  Home:   https://github.com/llvm/llvm-project
  Commit: cde8d0ad4324d7eec35e50eb9a46211ded2ce965
      https://github.com/llvm/llvm-project/commit/cde8d0ad4324d7eec35e50eb9a46211ded2ce965
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBasicBlockInfo.h
    M llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
    M llvm/lib/Target/ARM/ARMFrameLowering.cpp

  Log Message:
  -----------
  [ARM][Thumb1] Verify EstimateFunctionSizeInBytes every time

EstimateFunctionSizeInBytes is supposed to err on the side of
overestimating the function size, but historically, has sometimes
underestimated, leading to a code generation failure in
ARMConstantIslandPass in the rare case where the underestimate led
frame setup to fail to stack LR to permit intra-function BL.

To try to catch any remaining issues of this kind more reliably, this
patch arranges that the result of EstimateFunctionSizeInBytes is saved
in the ARMFunctionInfo, and in ARMConstantIslandPass, the estimate is
checked against the true function size _unconditionally_. So
underestimates should be detected even when they don't lead to an
actual problem. Moreover, enough debug output is now generated to
understand the basis of the estimate, and the true function size, and
compare them to see why the estimate wasn't big enough.

No extra tests are added in this commit, because the existing tests of
Thumb1 code generation in `llvm/test/CodeGen/Thumb` were already very
good at catching failures of this check, and pointed out most of the
detailed issues fixed in the previous patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list