2019-12-16 20:19:54 +08:00
|
|
|
; RUN: llc -mtriple aarch64-arm-linux-gnu --enable-machine-outliner \
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; RUN: -verify-machineinstrs %s -o - | FileCheck --check-prefixes CHECK,V8A %s
|
|
|
|
; RUN-V83A: llc -mtriple aarch64-arm-none-eabi -enable-machine-outliner \
|
|
|
|
; RUN-V83A: -verify-machineinstrs -mattr=+v8.3a %s -o - > %t
|
|
|
|
; RUN-V83A: FileCheck --check-prefixes CHECK,V83A < %t %s
|
2019-12-16 20:19:54 +08:00
|
|
|
|
|
|
|
declare i32 @thunk_called_fn(i32, i32, i32, i32)
|
|
|
|
|
|
|
|
define i32 @a() #0 {
|
|
|
|
; CHECK-LABEL: a: // @a
|
|
|
|
; CHECK: // %bb.0: // %entry
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A-NEXT: hint #25
|
|
|
|
; V83A-NEXT: paciasp
|
|
|
|
; V8A: hint #29
|
|
|
|
; V83A: autiasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4)
|
|
|
|
%cx = add i32 %call, 8
|
|
|
|
ret i32 %cx
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @b() #0 {
|
|
|
|
; CHECK-LABEL: b: // @b
|
|
|
|
; CHECK: // %bb.0: // %entry
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A-NEXT: hint #25
|
|
|
|
; V83A-NEXT: paciasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: .cfi_negate_ra_state
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A: hint #29
|
|
|
|
; V83A: autiasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 @thunk_called_fn(i32 1, i32 2, i32 3, i32 4)
|
|
|
|
%cx = add i32 %call, 88
|
|
|
|
ret i32 %cx
|
|
|
|
}
|
|
|
|
|
|
|
|
define hidden i32 @c(i32 (i32, i32, i32, i32)* %fptr) #0 {
|
|
|
|
; CHECK-LABEL: c: // @c
|
|
|
|
; CHECK: // %bb.0: // %entry
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A-NEXT: hint #25
|
|
|
|
; V83A-NEXT: paciasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: .cfi_negate_ra_state
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A: hint #29
|
|
|
|
; V83A: autiasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 %fptr(i32 1, i32 2, i32 3, i32 4)
|
|
|
|
%add = add nsw i32 %call, 8
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
define hidden i32 @d(i32 (i32, i32, i32, i32)* %fptr) #0 {
|
|
|
|
; CHECK-LABEL: d: // @d
|
|
|
|
; CHECK: // %bb.0: // %entry
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A-NEXT: hint #25
|
|
|
|
; V83A-NEXT: paciasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: .cfi_negate_ra_state
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; V8A: hint #29
|
|
|
|
; V83A: autiasp
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 %fptr(i32 1, i32 2, i32 3, i32 4)
|
|
|
|
%add = add nsw i32 %call, 88
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { "sign-return-address"="non-leaf" }
|
|
|
|
|
|
|
|
; CHECK-NOT: [[OUTLINED_FUNCTION_{{.*}}]]
|
|
|
|
; CHECK-NOT: .cfi_b_key_frame
|
|
|
|
; CHECK-NOT: paci{{[a,b]}}sp
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; CHECK-NOT: hint #2{{[5,7]}}
|
2019-12-16 20:19:54 +08:00
|
|
|
; CHECK-NOT: .cfi_negate_ra_state
|
|
|
|
; CHECK-NOT: auti{{[a,b]}}sp
|
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
2020-01-11 01:51:21 +08:00
|
|
|
; CHECK-NOT: hint #{{[29,31]}}
|