[llvm] [InstCombine] Combine ptrauth intrin. callee into same-key bundle. (PR #94707)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 12:03:08 PDT 2024


================
@@ -0,0 +1,76 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+define i32 @test_ptrauth_call_resign(ptr %p) {
+; CHECK-LABEL: @test_ptrauth_call_resign(
+; CHECK-NEXT:    [[V3:%.*]] = call i32 [[P:%.*]]() [ "ptrauth"(i32 1, i64 1234) ]
+; CHECK-NEXT:    ret i32 [[V3]]
+;
+  %v0 = ptrtoint ptr %p to i64
+  %v1 = call i64 @llvm.ptrauth.resign(i64 %v0, i32 1, i64 1234, i32 1, i64 5678)
+  %v2 = inttoptr i64 %v1 to i32()*
----------------
nikic wrote:

```suggestion
  %v2 = inttoptr i64 %v1 to ptr
```
Here and below.

https://github.com/llvm/llvm-project/pull/94707


More information about the llvm-commits mailing list