Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeGen] Move fentry-insert, xray-instrumentation and patchable-func…
…tion before addPreEmitPass() This intention is to move patchable-function before aarch64-branch-targets (configured in AArch64PassConfig::addPreEmitPass) so that we emit BTI before NOPs (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424). This also allows addPreEmitPass() passes to know the precise instruction sizes if they want. Tried x86-64 Debug/Release builds of ccls with -fxray-instrument -fxray-instruction-threshold=1. No output difference with this commit and the previous commit. (cherry picked from commit 9a24488)
- Loading branch information
Showing
7 changed files
with
45 additions
and
21 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
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,24 @@ | ||
; RUN: llc -mtriple=aarch64 %s -o - | FileCheck --check-prefixes=CHECK %s | ||
|
||
define i32 @f0() "patchable-function-entry"="0" "branch-target-enforcement" { | ||
; CHECK-LABEL: f0: | ||
; CHECK-NEXT: .Lfunc_begin0: | ||
; CHECK: hint #34 | ||
; CHECK-NEXT: mov w0, wzr | ||
; CHECK: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 | ||
; CHECK-NEXT: .p2align 3 | ||
; CHECK-NEXT: .xword .Lfunc_begin0 | ||
ret i32 0 | ||
} | ||
|
||
define i32 @f1() "patchable-function-entry"="1" "branch-target-enforcement" { | ||
; CHECK-LABEL: f1: | ||
; CHECK-NEXT: .Lfunc_begin1: | ||
; CHECK: hint #34 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: mov w0, wzr | ||
; CHECK: .section __patchable_function_entries,"awo",@progbits,f0,unique,0 | ||
; CHECK-NEXT: .p2align 3 | ||
; CHECK-NEXT: .xword .Lfunc_begin1 | ||
ret i32 0 | ||
} |
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