[all-commits] [llvm/llvm-project] a82b97: [CodeGen] Fix lpad padding at section start after ...

Fabian Parzefall via All-commits all-commits at lists.llvm.org
Wed Dec 3 18:29:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a82b97c524e851b0807b95c34a2154a2cbce9bdf
      https://github.com/llvm/llvm-project/commit/a82b97c524e851b0807b95c34a2154a2cbce9bdf
  Author: Fabian Parzefall <parzefall at meta.com>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

  Changed paths:
    M llvm/lib/CodeGen/BasicBlockSections.cpp
    M llvm/test/CodeGen/Generic/machine-function-splitter.ll

  Log Message:
  -----------
  [CodeGen] Fix lpad padding at section start after empty block (#112595)

If a landing pad is at the very start of a split section, it has to be
padded by a nop instruction. Otherwise its offset is marked as zero in
the LSDA, which means no landing pad (leading it to be skipped).

LLVM already handles this. If a landing pad is the first machine block
in a section, a nop is inserted to ensure a non-zero offset. However, if
the landing pad is preceeded by an empty block, the nop would be
omitted.

To fix this, this patch adds a field to machine blocks indicating
whether this block contains the first instruction in its section. This
variable is then used to determine whether to emit the padding.

Co-authored-by: Jinjie Huang <huangjinjie at bytedance.com>



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