[PATCH] D137557: [PtrAuth] Use default attributes for some ptrauth intrinsics

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 02:50:59 PST 2022


nikic updated this revision to Diff 480412.
nikic added a comment.
Herald added a subscriber: hiraditya.

Rebase to invert patch order.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137557/new/

https://reviews.llvm.org/D137557

Files:
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Transforms/Utils/Local.cpp


Index: llvm/lib/Transforms/Utils/Local.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Local.cpp
+++ llvm/lib/Transforms/Utils/Local.cpp
@@ -457,7 +457,6 @@
     case Intrinsic::wasm_trunc_unsigned:
     case Intrinsic::ptrauth_auth:
     case Intrinsic::ptrauth_resign:
-    case Intrinsic::ptrauth_sign:
       return true;
     default:
       return false;
Index: llvm/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/include/llvm/IR/Intrinsics.td
+++ llvm/include/llvm/IR/Intrinsics.td
@@ -2085,9 +2085,9 @@
 // Sign an unauthenticated pointer using the specified key and discriminator,
 // passed in that order.
 // Returns the first argument, with some known bits replaced with a signature.
-def int_ptrauth_sign : Intrinsic<[llvm_i64_ty],
-                                 [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty],
-                                 [IntrNoMem, ImmArg<ArgIndex<1>>]>;
+def int_ptrauth_sign :
+  DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty],
+                        [IntrNoMem, ImmArg<ArgIndex<1>>]>;
 
 // Authenticate a signed pointer, using the specified key and discriminator.
 // Returns the first argument, with the signature bits removed.
@@ -2113,15 +2113,14 @@
 // The second argument specifies the key.
 // This behaves like @llvm.ptrauth.auth, but doesn't require the signature to
 // be valid.
-def int_ptrauth_strip : Intrinsic<[llvm_i64_ty],
-                                  [llvm_i64_ty, llvm_i32_ty],
-                                  [IntrNoMem, ImmArg<ArgIndex<1>>]>;
+def int_ptrauth_strip :
+  DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty],
+                        [IntrNoMem, ImmArg<ArgIndex<1>>]>;
 
 // Blend a small integer discriminator with an address discriminator, producing
 // a new discriminator value.
-def int_ptrauth_blend : Intrinsic<[llvm_i64_ty],
-                                  [llvm_i64_ty, llvm_i64_ty],
-                                  [IntrNoMem]>;
+def int_ptrauth_blend :
+  DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
 
 // Compute the signature of a value, using a given discriminator.
 // This differs from @llvm.ptrauth.sign in that it doesn't embed the computed
@@ -2129,9 +2128,8 @@
 // That allows it to be used to sign non-pointer data: in that sense, it is
 // generic.  There is no generic @llvm.ptrauth.auth: instead, the signature
 // can be computed using @llvm.ptrauth.sign_generic, and compared with icmp.
-def int_ptrauth_sign_generic : Intrinsic<[llvm_i64_ty],
-                                         [llvm_i64_ty, llvm_i64_ty],
-                                         [IntrNoMem]>;
+def int_ptrauth_sign_generic :
+  DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
 
 //===----------------------------------------------------------------------===//
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137557.480412.patch
Type: text/x-patch
Size: 2977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221206/8b91b6d6/attachment.bin>


More information about the llvm-commits mailing list