forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][PAC] Select llvm.ptrauth.sign/sign.generic to PAC*.
The @llvm.ptrauth.sign/sign.generic intrinsics map cleanly to the various AArch64 PAC[IDG][Z][AB] instructions. Select them. Differential Revision: https://reviews.llvm.org/D91087
- Loading branch information
1 parent
3b463c4
commit e3a7f0e
Showing
5 changed files
with
141 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
llvm/test/CodeGen/AArch64/ptrauth-intrinsic-sign-generic.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=0 | FileCheck %s | ||
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=1 -global-isel-abort=1 | FileCheck %s | ||
|
||
define i64 @test_sign_generic(i64 %arg, i64 %arg1) { | ||
; CHECK-LABEL: test_sign_generic: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacga x0, x0, x1 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign.generic(i64 %arg, i64 %arg1) | ||
ret i64 %tmp | ||
} | ||
|
||
declare i64 @llvm.ptrauth.sign.generic(i64, i64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=0 | FileCheck %s | ||
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=1 -global-isel-abort=1 | FileCheck %s | ||
|
||
define i64 @test_sign_ia(i64 %arg, i64 %arg1) { | ||
; CHECK-LABEL: test_sign_ia: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacia x0, x1 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 0, i64 %arg1) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_ia_zero(i64 %arg) { | ||
; CHECK-LABEL: test_sign_ia_zero: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: paciza x0 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 0, i64 0) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_ib(i64 %arg, i64 %arg1) { | ||
; CHECK-LABEL: test_sign_ib: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacib x0, x1 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 1, i64 %arg1) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_ib_zero(i64 %arg) { | ||
; CHECK-LABEL: test_sign_ib_zero: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacizb x0 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 1, i64 0) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_da(i64 %arg, i64 %arg1) { | ||
; CHECK-LABEL: test_sign_da: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacda x0, x1 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 2, i64 %arg1) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_da_zero(i64 %arg) { | ||
; CHECK-LABEL: test_sign_da_zero: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacdza x0 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 2, i64 0) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_db(i64 %arg, i64 %arg1) { | ||
; CHECK-LABEL: test_sign_db: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacdb x0, x1 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 3, i64 %arg1) | ||
ret i64 %tmp | ||
} | ||
|
||
define i64 @test_sign_db_zero(i64 %arg) { | ||
; CHECK-LABEL: test_sign_db_zero: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: pacdzb x0 | ||
; CHECK-NEXT: ret | ||
%tmp = call i64 @llvm.ptrauth.sign(i64 %arg, i32 3, i64 0) | ||
ret i64 %tmp | ||
} | ||
|
||
declare i64 @llvm.ptrauth.sign(i64, i32, i64) |