-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[BOLT] Ensure remember and restore CFIs are in the same list #144348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,69 @@ | ||
| // This test checks that BOLT does not split remember and restore CFI states | ||
| // into different lists, which would cause an assertion failure. | ||
|
|
||
| # RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o | ||
| # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q | ||
| # RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s | ||
|
|
||
| # CHECK: BOLT-INFO: Target architecture: aarch64 | ||
| # CHECK: BOLT-INFO: enabling relocation mode | ||
| # CHECK-NOT: llvm-bolt: | ||
| # CHECK: BOLT-INFO: Starting stub-insertion pass | ||
|
|
||
| .text | ||
| .global main | ||
| .type main, %function | ||
|
|
||
| main: | ||
| .cfi_startproc | ||
| .cfi_def_cfa_offset 16 | ||
| .cfi_offset x30, -8 | ||
| .cfi_remember_state | ||
| mov x9, #0x3ff0000000000000 | ||
| mov x8, x0 | ||
| stp x30, x9, [sp, #-0x10]! | ||
| add x3, sp, #0x8 | ||
| mov x0, x1 | ||
| mov x1, x2 | ||
| mov x2, x8 | ||
| bl main | ||
| fcmp d0, #0.0 | ||
| b.ne main+0x34 | ||
|
|
||
| mov w0, wzr | ||
| ldr x30, [sp], #0x10 | ||
| .cfi_def_cfa_offset 0 | ||
| .cfi_restore x30 | ||
|
|
||
| ret | ||
| .cfi_restore_state | ||
| .cfi_remember_state | ||
|
|
||
| fmov x8, d0 | ||
| mov x9, #0x7ff0000000000000 | ||
| and x8, x8, #0x7fffffffffffffff | ||
| cmp x8, x9 | ||
| b.lt main+0x5c | ||
| fcmp d0, #0.0 | ||
| mov w8, #-0x1 | ||
| csinc w0, w8, wzr, le | ||
| ldr x30, [sp], #0x10 | ||
Asher8118 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .cfi_def_cfa_offset 0 | ||
| .cfi_restore x30 | ||
|
|
||
| ret | ||
| nop | ||
| .cfi_restore_state | ||
|
|
||
| ldr d2, [sp, #0x8] | ||
| mov x8, #0x3cb0000000000000 | ||
| fabs d1, d0 | ||
| fcmp d0, #0.0 | ||
| fmov d3, x8 | ||
| mov w8, #-0x1 | ||
| csinc w0, w8, wzr, le | ||
| fmul d2, d2, d3 | ||
| fcmp d1, d2 | ||
| b.ls main+0x28 | ||
| b main+0x2c | ||
| .cfi_endproc | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.