LLVM 20.0.0git
Macros | Functions | Variables
AArch64SLSHardening.cpp File Reference
#include "AArch64InstrInfo.h"
#include "AArch64Subtarget.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/CodeGen/IndirectThunks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/Pass.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <climits>
#include <tuple>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "aarch64-sls-hardening"
 
#define AARCH64_SLS_HARDENING_NAME   "AArch64 sls hardening pass"
 

Functions

static const ThunkKind * getThunkKind (unsigned OriginalOpcode)
 
static bool isBLR (const MachineInstr &MI)
 
static void insertSpeculationBarrier (const AArch64Subtarget *ST, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, DebugLoc DL, bool AlwaysUseISBDSB=false)
 
static SmallString< 32 > createThunkName (const ThunkKind &Kind, Register Xn, Register Xm)
 
static std::tuple< const ThunkKind &, Register, RegisterparseThunkName (StringRef ThunkName)
 
 INITIALIZE_PASS (AArch64SLSHardening, "aarch64-sls-hardening", AARCH64_SLS_HARDENING_NAME, false, false) FunctionPass *llvm
 

Variables

static constexpr StringRef CommonNamePrefix = "__llvm_slsblr_thunk_"
 

Macro Definition Documentation

◆ AARCH64_SLS_HARDENING_NAME

#define AARCH64_SLS_HARDENING_NAME   "AArch64 sls hardening pass"

Definition at line 37 of file AArch64SLSHardening.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "aarch64-sls-hardening"

Definition at line 35 of file AArch64SLSHardening.cpp.

Function Documentation

◆ createThunkName()

static SmallString< 32 > createThunkName ( const ThunkKind &  Kind,
Register  Xn,
Register  Xm 
)
static

Definition at line 279 of file AArch64SLSHardening.cpp.

References CommonNamePrefix, llvm::formatv(), and N.

◆ getThunkKind()

static const ThunkKind * getThunkKind ( unsigned  OriginalOpcode)
static

Definition at line 178 of file AArch64SLSHardening.cpp.

Referenced by isBLR().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( AArch64SLSHardening  ,
"aarch64-sls-hardening"  ,
AARCH64_SLS_HARDENING_NAME  ,
false  ,
false   
)

Definition at line 522 of file AArch64SLSHardening.cpp.

◆ insertSpeculationBarrier()

static void insertSpeculationBarrier ( const AArch64Subtarget ST,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
DebugLoc  DL,
bool  AlwaysUseISBDSB = false 
)
static

◆ isBLR()

static bool isBLR ( const MachineInstr MI)
static

Definition at line 195 of file AArch64SLSHardening.cpp.

References getThunkKind(), and MI.

◆ parseThunkName()

static std::tuple< const ThunkKind &, Register, Register > parseThunkName ( StringRef  ThunkName)
static

Variable Documentation

◆ CommonNamePrefix

constexpr StringRef CommonNamePrefix = "__llvm_slsblr_thunk_"
staticconstexpr

Definition at line 45 of file AArch64SLSHardening.cpp.

Referenced by createThunkName(), and parseThunkName().