This patch makes the following changes to the schedule of instructions in the prologue and epilogue. The stack pointer update is moved down in the prologue so that the callee saves do not have to wait for the update to happen. Saving the lr is moved down in the prologue to hide the latency of the mflr. The stack pointer is moved up in the epilogue so that restoring of the lr can happen sooner. The mtlr is moved up in the epilogue so that it is away form the blr at the end of the epilogue. The latency of the mtlr can now be hidden by the loads of the callee saved registers. This commit is almost identical to this one: r322036 except that two warnings that broke build bots have been fixed. The revision number is D41737 as before. llvm-svn: 322124
33 lines
1.1 KiB
LLVM
33 lines
1.1 KiB
LLVM
; Note the formula for negative number alignment calculation should be y = x & ~(n-1) rather than y = (x + (n-1)) & ~(n-1).
|
|
; after patch https://reviews.llvm.org/D34337, we could save 16 bytes in the best case.
|
|
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-BE
|
|
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-LE
|
|
|
|
define signext i32 @bar(i32 signext %ii) {
|
|
entry:
|
|
%0 = tail call i32 asm sideeffect "add $0, $1, $2\0A", "=r,r,r,~{f14},~{r15},~{v20}"(i32 %ii, i32 10)
|
|
ret i32 %0
|
|
; Before the fix by patch D34337:
|
|
; stdu 1, -544(1)
|
|
; std 15, 264(1)
|
|
; stfd 14, 400(1)
|
|
; stdu 1, -560(1)
|
|
; std 15, 280(1)
|
|
; stfd 14, 416(1)
|
|
|
|
; After the fix by patch D34337:
|
|
; CHECK-LE:std 15, -280(1)
|
|
; CHECK-LE:stfd 14, -144(1)
|
|
; CHECK-LE: stdu 1, -528(1)
|
|
; CHECK-BE:std 15, -280(1)
|
|
; CHECK-BE:stfd 14, -144(1)
|
|
; CHECK-BE: stdu 1, -544(1)
|
|
}
|
|
|
|
define signext i32 @foo() {
|
|
entry:
|
|
%call = tail call signext i32 @bar(i32 signext 5)
|
|
ret i32 %call
|
|
}
|
|
|