[llvm-branch-commits] [llvm] Add llvm.protected.field.ptr intrinsic and pre-ISel lowering. (PR #151647)
Nikita Popov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 2 08:34:56 PST 2025
================
@@ -461,6 +463,139 @@ bool PreISelIntrinsicLowering::expandMemIntrinsicUses(
return Changed;
}
+static bool expandProtectedFieldPtr(Function &Intr) {
+ Module &M = *Intr.getParent();
+
+ SmallPtrSet<GlobalValue *, 2> DSsToDeactivate;
+
+ Type *Int8Ty = Type::getInt8Ty(M.getContext());
+ Type *Int64Ty = Type::getInt64Ty(M.getContext());
+ PointerType *PtrTy = PointerType::get(M.getContext(), 0);
+
+ Function *SignIntr =
+ Intrinsic::getOrInsertDeclaration(&M, Intrinsic::ptrauth_sign, {});
+ Function *AuthIntr =
+ Intrinsic::getOrInsertDeclaration(&M, Intrinsic::ptrauth_auth, {});
+
+ auto *EmuFnTy = FunctionType::get(Int64Ty, {Int64Ty, Int64Ty}, false);
+ FunctionCallee EmuSignIntr = M.getOrInsertFunction("__emupac_pacda", EmuFnTy);
+ FunctionCallee EmuAuthIntr = M.getOrInsertFunction("__emupac_autda", EmuFnTy);
----------------
nikic wrote:
We should avoid inserting function declarations that are not going to be used. I think this late we'll end up actually emitting those symbols.
https://github.com/llvm/llvm-project/pull/151647
More information about the llvm-branch-commits
mailing list