[all-commits] [llvm/llvm-project] 6b1365: [BOLT][AArch64] Transform cmpbr ~> cmp + br when i...

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Thu Jun 4 02:58:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b13656fd8386f979e061cc97e32b607ee3fcdf4
      https://github.com/llvm/llvm-project/commit/6b13656fd8386f979e061cc97e32b607ee3fcdf4
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M bolt/include/bolt/Core/BinaryFunction.h
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/include/bolt/Passes/LongJmp.h
    M bolt/include/bolt/Utils/CommandLineOpts.h
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Passes/BinaryPasses.cpp
    M bolt/lib/Passes/LongJmp.cpp
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    M bolt/lib/Target/AArch64/CMakeLists.txt
    M bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp
    M bolt/lib/Target/X86/X86MCPlusBuilder.cpp
    M bolt/lib/Utils/CommandLineOpts.cpp
    M bolt/test/AArch64/compare-and-branch-inversion.S
    M bolt/unittests/Core/CMakeLists.txt
    M bolt/unittests/Core/MCPlusBuilder.cpp

  Log Message:
  -----------
  [BOLT][AArch64] Transform cmpbr ~> cmp + br when inversion not possible (#185731)

When reordering blocks we may have to invert branches. Sometimes this
isn't possible for compare-and-branch instructions because the immediate
value would overflow/underflow after the adjustment. In such cases I am
splitting the instruction into a compare followed by a branch. For this
to be legal we should be sure that the condition flags are not being
clobbered. Liveness analysis may help here.



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