[all-commits] [llvm/llvm-project] cc53b9: [AArch64] When hardening against SLS, only create ...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Fri Jul 5 03:12:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc53b953acebfe47504bfd1af1f71b5906a974bf
      https://github.com/llvm/llvm-project/commit/cc53b953acebfe47504bfd1af1f71b5906a974bf
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2024-07-05 (Fri, 05 Jul 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64.h
    M llvm/lib/Target/AArch64/AArch64SLSHardening.cpp
    M llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
    M llvm/test/CodeGen/AArch64/O0-pipeline.ll
    M llvm/test/CodeGen/AArch64/O3-pipeline.ll
    M llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll
    M llvm/test/CodeGen/AArch64/speculation-hardening-sls-blr-bti.mir
    M llvm/test/CodeGen/AArch64/speculation-hardening-sls-blr.mir

  Log Message:
  -----------
  [AArch64] When hardening against SLS, only create called thunks  (#97472)

In preparation for implementing hardening of BLRA* instructions,
restrict thunk function generation to only the thunks being actually
called from any function. As described in the existing comments,
emitting all possible thunks for BLRAA and BLRAB instructions would mean
adding about 1800 functions in total, most of which are likely not to be
called.

This commit merges AArch64SLSHardening class into SLSBLRThunkInserter,
so thunks can be created as needed while rewriting a machine function.
The usages of TII, TRI and ST fields of AArch64SLSHardening class are
replaced with requesting them in-place, as ThunkInserter assumes
multiple "entry points" in contrast to the only runOnMachineFunction
method of AArch64SLSHardening.

The runOnMachineFunction method essentially replaces pre-existing
insertThunks implementation as there is no more need to insert all
possible thunks unconditionally. Instead, thunks are created on first
use from inside of insertThunks method.



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