[llvm-branch-commits] [llvm] [AArch64] Only create called thunks when hardening against SLS (PR #97472)
Kristof Beyls via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jul 3 05:44:10 PDT 2024
================
@@ -36,38 +32,43 @@ using namespace llvm;
#define AARCH64_SLS_HARDENING_NAME "AArch64 sls hardening pass"
+static const char SLSBLRNamePrefix[] = "__llvm_slsblr_thunk_";
+
namespace {
-class AArch64SLSHardening : public MachineFunctionPass {
-public:
- const TargetInstrInfo *TII;
- const TargetRegisterInfo *TRI;
- const AArch64Subtarget *ST;
+// Set of inserted thunks: bitmask with bits corresponding to
+// indexes in SLSBLRThunks array.
+typedef uint32_t ThunksSet;
- static char ID;
-
- AArch64SLSHardening() : MachineFunctionPass(ID) {
- initializeAArch64SLSHardeningPass(*PassRegistry::getPassRegistry());
+struct SLSBLRThunkInserter : ThunkInserter<SLSBLRThunkInserter, ThunksSet> {
----------------
kbeyls wrote:
I'm not sure if `SLSBLRThunkInserter` is the most appropriate name for this class.
IIUC, this class will also harden Returns and BRs, (see method `hardenReturnsAndBRs`), which does not insert thunks.
If I understand this correctly, I think sticking with the original name of "AArch64SLSHardening" describes better what this class does?
https://github.com/llvm/llvm-project/pull/97472
More information about the llvm-branch-commits
mailing list