[all-commits] [llvm/llvm-project] bb0403: [ARM] Remove redundant BTI instructions for table ...

Jirui-Wu via All-commits all-commits at lists.llvm.org
Fri Feb 24 02:33:13 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb0403ae2e8f872369b1ce6f88d42d8bf02b922e
  Author: Jirui Wu <jirui.wu at arm.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBranchTargets.cpp
    M llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
    M llvm/test/CodeGen/Thumb2/bti-indirect-branches.ll
    M llvm/test/CodeGen/Thumb2/bti-jump-table.mir
    A llvm/test/MC/ARM/remove-redundant-bti.ll

  Log Message:
  [ARM] Remove redundant BTI instructions for table jumps

A BTI instruction was previously inserted at the beginning of each block
that has its address stored in a jump table. Jump tables only emit
indirect jumps in ARM or Thumb1 modes. However, PACBTI is not supported
in these modes. As a result, BTI instructions emitted by jump tables are
redundant. Removing redundant BTI instructions improves the code size
and prevents potential gadgets.

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

More information about the All-commits mailing list