[all-commits] [llvm/llvm-project] b12449: [CodeGen] Refactor and document ThunkInserter (#97...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Thu Jul 4 07:04:08 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/CodeGen/IndirectThunks.h
    M llvm/lib/Target/AArch64/AArch64SLSHardening.cpp
    M llvm/lib/Target/ARM/ARMSLSHardening.cpp
    M llvm/lib/Target/X86/X86IndirectThunks.cpp

  Log Message:
  -----------
  [CodeGen] Refactor and document ThunkInserter (#97468)

In preparation for supporting BLRA* instructions in SLS Hardening on
AArch64, refactor ThunkInserter class.

The main intention of this commit is to document the way to merge the
BLR-rewriting logic of the AArch64SLSHardening pass into the
SLSBLRThunkInserter class. This makes it possible to only call
createThunkFunction for the thunks that are actually referenced.
Ultimately, it will prevent SLSBLRThunkInserter from unconditionally
generating about 1800 thunk functions corresponding to every possible
combination of operands passed to BLRAA or BLRAB instructions.

This particular commit does not affect the generated machine code and
consists of the following changes:
* document the existing behavior of ThunkInserter class
* introduce ThunkInserterPass template class to get rid of mostly
identical boilerplate code in ARM, AArch64 and X86 implementations
* move the InsertedThunks parameter from `mayUseThunk` to `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