[all-commits] [llvm/llvm-project] d7bca8: [AArch64] Relax cross-section branches

Daniel Hoekwater via All-commits all-commits at lists.llvm.org
Tue Aug 15 18:43:51 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7bca8e4942b97a6442425d5f741cb4665582446
  Author: Daniel Hoekwater <hoekwater at google.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M llvm/include/llvm/Target/TargetMachine.h
    M llvm/lib/CodeGen/BranchRelaxation.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.h
    M llvm/lib/Target/TargetMachine.cpp
    A llvm/test/CodeGen/AArch64/branch-relax-b.ll
    A llvm/test/CodeGen/AArch64/branch-relax-cross-section.mir

  Log Message:
  [AArch64] Relax cross-section branches

Because the code layout is not known during compilation, the distance of
cross-section jumps is not knowable at compile-time. Because of this, we
should assume that any cross-sectional jumps are out of range. This
assumption is necessary for machine function splitting on AArch64, which
introduces cross-section branches in the middle of functions. The linker
relaxes out-of-range unconditional branches, but it clobbers X16 to do
so; it doesn't relax conditional branches, which must be manually
relaxed by the compiler.

Differential Revision: https://reviews.llvm.org/D145211

More information about the All-commits mailing list