-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain""
This reverts commit bc9a29b. The reasoning that this patch was wrong was itself incorrect (see discussion on llvm-commits). This patch does seem to be exposing a latent SVE code generation bug on non-public tests, which should not block a correctness fix for public, non-SVE use cases.
- Loading branch information
Showing
6 changed files
with
125 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
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,22 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -disable-post-ra --frame-pointer=all < %s | FileCheck %s | ||
|
||
; The purpose of this test is to verify that frame pointer (x29) | ||
; is correctly setup in the presence of callee-saved floating | ||
; point registers. The frame pointer should point to the frame | ||
; record, which is located 16 bytes above the end of the CSR | ||
; space when a single FP CSR is in use. | ||
define void @test1(i32) #26 { | ||
entry: | ||
call void asm sideeffect "nop", "~{d8}"() #26 | ||
ret void | ||
} | ||
; CHECK-LABEL: test1: | ||
; CHECK: str d8, [sp, #-32]! | ||
; CHECK-NEXT: stp x29, x30, [sp, #16] | ||
; CHECK-NEXT: add x29, sp, #16 | ||
; CHECK: nop | ||
; CHECK: ldp x29, x30, [sp, #16] | ||
; CHECK-NEXT: ldr d8, [sp], #32 | ||
; CHECK-NEXT: ret | ||
|
||
attributes #26 = { nounwind } |
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,29 @@ | ||
# RUN: llc -mtriple=aarch64-linux-gnu -start-before prologepilog %s -o - | FileCheck %s | ||
|
||
--- | ||
name: TestFrameRecordLocation | ||
tracksRegLiveness: true | ||
frameInfo: | ||
isFrameAddressTaken: true | ||
body: | | ||
bb.0: | ||
$d8 = IMPLICIT_DEF | ||
$d9 = IMPLICIT_DEF | ||
$x19 = IMPLICIT_DEF | ||
RET_ReallyLR | ||
# CHECK-LABEL: TestFrameRecordLocation | ||
|
||
# CHECK: stp d9, d8, [sp, #-48]! | ||
# CHECK: stp x29, x30, [sp, #16] | ||
# CHECK: str x19, [sp, #32] | ||
|
||
# CHECK: add x29, sp, #16 | ||
|
||
# CHECK: .cfi_def_cfa w29, 32 | ||
# CHECK: .cfi_offset w19, -16 | ||
# CHECK: .cfi_offset w30, -24 | ||
# CHECK: .cfi_offset w29, -32 | ||
# CHECK: .cfi_offset b8, -40 | ||
# CHECK: .cfi_offset b9, -48 | ||
... |
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,42 @@ | ||
; RUN: llc -verify-machineinstrs < %s | FileCheck %s | ||
|
||
; The purpose of this test is to construct a scenario where an odd number | ||
; of callee-saved GPRs as well as an odd number of callee-saved FPRs are | ||
; used. This caused the frame pointer to be aligned to a multiple of 8 | ||
; on non-Darwin platforms, rather than a multiple of 16 as usual. | ||
|
||
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" | ||
target triple = "aarch64-unknown-linux-gnu" | ||
|
||
@a = global i64 0, align 4 | ||
|
||
|
||
define i64 @b() { | ||
entry: | ||
%call = tail call i64 @d() | ||
%0 = alloca i8, i64 ptrtoint (i64 ()* @d to i64), align 16 | ||
%1 = ptrtoint i8* %0 to i64 | ||
store i64 %1, i64* @a, align 4 | ||
%call1 = call i64 @e() | ||
%conv = sitofp i64 %call1 to float | ||
%2 = load i64, i64* @a, align 4 | ||
%call2 = call i64 @f(i64 %2) | ||
%conv3 = fptosi float %conv to i64 | ||
ret i64 %conv3 | ||
} | ||
|
||
; CHECK-LABEL: b: | ||
; CHECK: str d8, [sp, #-32]! | ||
; CHECK-NEXT: stp x29, x30, [sp, #8] | ||
; CHECK-NEXT: str x19, [sp, #24] | ||
; CHECK-NEXT: add x29, sp, #8 | ||
|
||
; CHECK: sub sp, x29, #8 | ||
; CHECK-NEXT: ldr x19, [sp, #24] | ||
; CHECK-NEXT: ldp x29, x30, [sp, #8] | ||
; CHECK-NEXT: ldr d8, [sp], #32 | ||
; CHECK-NEXT: ret | ||
|
||
declare i64 @d() | ||
declare i64 @e() | ||
declare i64 @f(i64) |